forked from Qwant/idunn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (23 loc) · 1.01 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
FROM python:3.6-slim
RUN apt-get update && apt-get -y install git
RUN useradd -r app_user
RUN mkdir /app
RUN chown app_user /app/
WORKDIR /app
# Installing packages
RUN pip install pipenv gunicorn==19.8.1 meinheld==0.6.1
ADD --chown=app_user app.py Pipfile* /app/
RUN pipenv install --system --deploy
USER app_user
# the sources are copied as late as possible since they are likely to change often
ADD --chown=app_user idunn /app/idunn
# set the multiprocess mode for gunicorn
ENV IDUNN_PROMETHEUS_MULTIPROC=1
ENV prometheus_multiproc_dir=/app/idunn/prometheus_multiproc
RUN mkdir /app/idunn/prometheus_multiproc
EXPOSE 5000
ADD --chown=app_user gunicorn_logging.conf .
# You can set the number of workers by passing --workers=${NB_WORKER} to the docker run command.
# For some reason, an array is required here to accept other params on run.
ENTRYPOINT ["gunicorn", "app:app", "--bind=0.0.0.0:5000", "--pid=pid", \
"--worker-class=meinheld.gmeinheld.MeinheldWorker", "--preload", "--log-config=/app/gunicorn_logging.conf"]