covid-formity/Dockerfile

33 lines
1.1 KiB
Docker
Raw Permalink Normal View History

2020-03-26 08:15:59 +00:00
FROM alpine:3.11.3@sha256:ddba4d27a7ffc3f86dd6c2f92041af252a1f23a8e742c90e6e1297bfa1bc0c45
EXPOSE 5000
WORKDIR /usr/src/app
RUN apk add --no-cache \
uwsgi-python3 \
python3 \
libpq git
# psycopg2 needs some extra build tools and headers. Install them and build in a
# single step in order not to pollute Docker layers
RUN apk add --no-cache --virtual .build-deps gcc python3-dev musl-dev postgresql-dev libffi-dev && \
2020-04-21 06:37:32 +00:00
pip3 install --no-cache-dir psycopg2==2.8.4 pycparser==2.20 cffi==1.14.0 bcrypt==3.1.7 pycryptodome==3.9.7 && \
2020-03-26 08:15:59 +00:00
apk del --no-cache .build-deps
2020-04-19 20:21:32 +00:00
RUN apk add --no-cache py3-pillow cairo pango glib font-noto gdk-pixbuf-dev
2020-04-08 18:09:24 +00:00
2020-03-26 08:15:59 +00:00
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
ENV FLASK_APP formity
ENV FLASK_ENV production
COPY . .
2020-03-30 07:12:37 +00:00
ENV prometheus_multiproc_dir /tmp
2020-03-26 08:15:59 +00:00
STOPSIGNAL SIGINT
2020-03-26 20:15:18 +00:00
USER uwsgi
2020-03-26 08:15:59 +00:00
CMD flask db upgrade && exec uwsgi --http-socket 0.0.0.0:5000 \
--processes 4 \
--plugins python3 \
--wsgi formity.wsgi:application \
--touch-reload formity/wsgi.py