-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (24 loc) · 853 Bytes
/
Dockerfile
File metadata and controls
37 lines (24 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM python:3.11.1-alpine3.17
LABEL maintainer=jon@kosli.com
ARG XY_USER_NAME
RUN apk --update --upgrade add bash jq tini \
&& apk update \
&& adduser -D -g "" ${XY_USER_NAME}
ENV PATH="/home/xy/.local/bin:${PATH}"
USER ${XY_USER_NAME}
COPY source/requirements.txt /tmp/requirements.txt
RUN pip3 install --requirement /tmp/requirements.txt --user
ARG XY_CONTAINER_ROOT_DIR \
XY_CONTAINER_PORT \
XY_GIT_COMMIT_SHA
ENV XY_CONTAINER_ROOT_DIR=${XY_CONTAINER_ROOT_DIR} \
XY_CONTAINER_PORT=${XY_CONTAINER_PORT} \
XY_GIT_COMMIT_SHA=${XY_GIT_COMMIT_SHA} \
PYTHONPATH=${XY_CONTAINER_ROOT_DIR}/source \
PYTHONPYCACHEPREFIX=/tmp/py_caches \
TERM=xterm-256color
WORKDIR ${XY_CONTAINER_ROOT_DIR}
COPY . .
EXPOSE "${XY_CONTAINER_PORT}"
ENTRYPOINT [ "/sbin/tini", "-g", "--" ]
CMD ${XY_CONTAINER_ROOT_DIR}/source/gunicorn.sh