-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
46 lines (37 loc) · 1.33 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
FROM python:3.7.17-alpine3.18 as builder
WORKDIR /app
EXPOSE 80
ENV FLASK_APP "manage.py"
ENV FLASK_CONFIG "production"
# Setup deps
RUN apk update && apk add py3-psycopg2 musl-dev \
nginx supervisor git \
openssl ca-certificates \
gcc postgresql-dev \
&& pip install --upgrade pip
# Setup nginx
RUN mkdir -p /run/nginx && \
mkdir -p /etc/nginx/sites-available && \
mkdir /etc/nginx/sites-enabled && \
rm -f /etc/nginx/sites-enabled/default && \
rm -f /etc/nginx/conf.d/default.conf
COPY bin/nginx.conf /etc/nginx/nginx.conf
# Setup supervisord
RUN mkdir -p /var/log/supervisor/conf.d
COPY bin/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Setup dataservice
COPY requirements.txt /app/
RUN pip install "cython<3.0.0" && pip install --no-build-isolation "pyyaml==5.4.0"
RUN pip install -r /app/requirements.txt
COPY manage.py setup.py config.py /app/
COPY bin bin
COPY docs docs
COPY migrations migrations
COPY dataservice dataservice
COPY .git .git
RUN python /app/setup.py install
# Start processes
CMD ["/app/bin/run.sh"]
FROM builder as test
COPY dev-requirements.txt /app/
RUN pip install -r /app/dev-requirements.txt