-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
53 lines (37 loc) · 1.24 KB
/
Dockerfile
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
FROM python:3.7-alpine3.7 as base
ADD requirements.txt /app/
WORKDIR /app
ENV WORKER false
RUN apk --update add py3-psycopg2 \
musl-dev \
supervisor \
git \
ca-certificates \
libffi-dev \
libressl-dev \
gcc \
postgresql-dev \
postgresql-client \
&& pip install --upgrade pip
# Python deps
RUN pip install -r /app/requirements.txt
RUN pip install awscli
ADD . /app
# Bake version number
RUN COMMIT=`git rev-parse --short HEAD` && echo "COMMIT=\"${COMMIT}\"" > /app/coordinator/version_info.py \
&& VERSION=`git describe --always --tags` && echo "VERSION=\"${VERSION}\"" >> /app/coordinator/version_info.py
RUN python /app/setup.py install \
&& python /app/manage.py collectstatic -v0 --noinput
EXPOSE 80
# Setup supervisord
RUN mkdir -p /var/log/supervisor/conf.d
COPY bin/worker.conf /etc/supervisor/conf.d/worker.conf
COPY bin/api.conf /etc/supervisor/conf.d/api.conf
# Start processes
CMD ["/app/bin/entrypoint.sh"]
FROM base as dev
COPY dev-requirements.txt /app/
RUN pip install -r /app/dev-requirements.txt
# Production stage
FROM base as prd
CMD ["/app/bin/entrypoint.sh"]