Commit 3b86473f authored by Christophe Benz's avatar Christophe Benz

Fix Dockerfile and PDF generation

parent a05ae766
...@@ -6,25 +6,23 @@ EXPOSE 5000 ...@@ -6,25 +6,23 @@ EXPOSE 5000
RUN pip install --no-cache-dir gunicorn==19.9.0 RUN pip install --no-cache-dir gunicorn==19.9.0
RUN apt-get update && \ RUN apt-get update && \
apt-get install --yes chromium=73.0.3683.75-1~deb9u1 apt-get install --yes --no-install-recommends chromium=73.0.3683.75-1~deb9u1
ARG user=jenkins
ARG group=jenkins
ARG uid=1000 ARG uid=1000
ARG gid=1000 ARG gid=1000
RUN groupadd -g ${gid} ${group} && \ RUN groupadd -g ${gid} validata && \
useradd -u ${uid} -g ${gid} --no-create-home --shell /bin/bash ${user} useradd -u ${uid} -g ${gid} --create-home --shell /bin/bash validata
WORKDIR /app # Cf and
USER validata
COPY requirements.txt . WORKDIR /app
RUN pip install --no-cache-dir --requirement requirements.txt
COPY . . COPY --chown=validata:validata requirements.txt .
RUN pip install --no-cache-dir --editable . RUN pip install --no-cache-dir --user --requirement requirements.txt --no-warn-script-location
# Cf COPY --chown=validata:validata . .
USER ${user} RUN pip install --no-cache-dir --user --editable .
CMD gunicorn --bind validata_ui:app CMD gunicorn --workers 4 --bind validata_ui:app
\ No newline at end of file
...@@ -478,7 +478,7 @@ def pdf_report(): ...@@ -478,7 +478,7 @@ def pdf_report():
tmp_pdf_report = Path( tmp_pdf_report = Path(
# Use chromium headless to generate PDF from validation report page # Use chromium headless to generate PDF from validation report page
cmd = ['chromium', '--headless', '--disable-gpu', cmd = ['chromium', '--headless', '--no-sandbox',
'--print-to-pdf={}'.format(str(tmp_pdf_report)), validation_url] '--print-to-pdf={}'.format(str(tmp_pdf_report)), validation_url]
result =, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) result =, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if result.returncode != 0: if result.returncode != 0:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment