This repository was archived by the owner on Feb 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (29 loc) · 1.24 KB
/
Dockerfile
File metadata and controls
38 lines (29 loc) · 1.24 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
##############################################
FROM alpine:3.13.1 as project-base
WORKDIR /app
ENV VIRTUAL_ENV=/opt/venv
RUN apk add --no-cache \
python3-dev py3-virtualenv postgresql-dev \
&& python3 -m ensurepip --upgrade \
&& rm -r /usr/lib/python*/ensurepip \
&& pip3 install --upgrade pip setuptools \
&& if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi \
&& if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi \
&& python3 -m virtualenv --python /usr/bin/python3 $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
##############################################
FROM project-base as dependency-creator
RUN apk add --no-cache build-base libffi-dev \
&& pip3 install --no-cache-dir poetry
COPY poetry.lock pyproject.toml ./
RUN poetry export -f requirements.txt > /requirements.txt && pip3 install -r /requirements.txt
##############################################
FROM project-base as prod-container
RUN apk add --no-cache bash supervisor jq
COPY --from=dependency-creator /opt/venv /opt/venv
COPY supervisord.conf /etc/supervisord.conf
COPY email-templates/ /app/email-templates
COPY gunicorn.conf /app
COPY .env /app
COPY app /app
ENTRYPOINT ["supervisord", "-c", "/etc/supervisord.conf"]