Dockerfile 880 Bytes
Newer Older
1
FROM python:3.7-stretch
2 3 4 5
LABEL maintainer="admin-validata@jailbreak.paris"

EXPOSE 5000

Christophe Benz's avatar
Christophe Benz committed
6
RUN pip install --no-cache-dir gunicorn==19.9.0
7 8

RUN apt-get update && \
9
  apt-get install --yes --no-install-recommends chromium=73.0.3683.75-1~deb9u1
10

11 12 13
ARG uid=1000
ARG gid=1000

14 15
RUN groupadd -g ${gid} validata && \
  useradd -u ${uid} -g ${gid} --create-home --shell /bin/bash validata
16

17 18
# Cf https://bugs.chromium.org/p/chromium/issues/detail?id=638180 and https://blog.ineat-conseil.fr/2018/08/executer-karma-avec-chromeheadless-dans-un-conteneur-docker/
USER validata
19

Christophe Benz's avatar
Christophe Benz committed
20
WORKDIR /home/validata/
21

22 23
COPY --chown=validata:validata requirements.txt .
RUN pip install --no-cache-dir --user --requirement requirements.txt --no-warn-script-location
24

25 26
COPY --chown=validata:validata . .
RUN pip install --no-cache-dir --user --editable .
27

28
CMD gunicorn --workers 4 --bind 0.0.0.0:5000 validata_ui:app