-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
26 lines (18 loc) · 875 Bytes
/
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
FROM python:3.10-slim
ENV GUNICORN_PORT=8000
ENV GUNICORN_MODULE=open_budget_data_api.main
ENV GUNICORN_CALLABLE=app
ENV GUNICORN_USER=gunicorn
ENV APP_PATH=/opt/app
# RUN apk add --update --virtual=build-dependencies wget ca-certificates python3-dev postgresql-dev build-base libffi-dev
# RUN apk add --update libpq
RUN apt-get update && apt-get install --no-install-recommends -y libpq-dev && update-ca-certificates
# Install dependencies and create runtime user.
RUN pip3 install --upgrade pip gunicorn[gevent] \
&& adduser --disabled-password --home $APP_PATH $GUNICORN_USER
ADD . $APP_PATH
RUN cd $APP_PATH \
&& pip3 install -r requirements.txt
USER $GUNICORN_USER
EXPOSE 8000
CMD cd $APP_PATH && gunicorn -t 120 --bind 0.0.0.0:$GUNICORN_PORT -k gevent -w 8 --limit-request-line 0 --log-level debug --access-logfile - $GUNICORN_MODULE:$GUNICORN_CALLABLE