-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (46 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
59 lines (46 loc) · 1.09 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM alpine:3.15 as builder
RUN apk add --no-cache \
python3 \
py3-pip
RUN pip install --no-cache-dir \
pipenv \
setuptools \
wheel
WORKDIR "/etc/hashmaps"
COPY Pipfile ./
COPY Pipfile.lock ./
RUN pipenv install --clear \
--deploy \
--system \
--verbose
FROM alpine:3.15
RUN apk add --no-cache \
bash \
python3 \
su-exec \
uwsgi \
uwsgi-python3 \
\
&& ln -s /usr/bin/python3 /usr/local/bin/python \
&& adduser -h /var/www \
-s /bin/bash \
-u 82 \
-G www-data \
-D \
\
www-data
COPY --from=builder /usr/lib/python3.9/site-packages /usr/lib/python3.9/site-packages
ARG SOURCE_DIR="/opt/hashmaps"
ARG DATA_VOLUME="/var/lib/hashmaps"
WORKDIR "${SOURCE_DIR}"
COPY src/ ./
COPY entrypoint.sh /
ENV SOURCE_DIR="${SOURCE_DIR}"
ENV DATA_VOLUME="${DATA_VOLUME}"
ENV TMPDIR="${DATA_VOLUME}/tmp"
ENV DEBUG=""
ENV SECRET_KEY=""
ENTRYPOINT ["/entrypoint.sh"]
CMD ["uwsgi"]
EXPOSE 8000
VOLUME ["${DATA_VOLUME}"]