]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Adds the Python environment flags for no byte code saving, reducing the image size...
authorTrenton H <797416+stumpylog@users.noreply.github.com>
Thu, 8 Feb 2024 02:45:59 +0000 (18:45 -0800)
committerGitHub <noreply@github.com>
Thu, 8 Feb 2024 02:45:59 +0000 (02:45 +0000)
Dockerfile

index 73bd0cf573b3e411195c3fc859e2d976f02de5a8..ea5bd602619562278610df1202c8614bebeef4cc 100644 (file)
@@ -39,8 +39,6 @@ RUN set -eux \
 #  - Don't leave anything extra in here
 FROM docker.io/python:3.11-slim-bookworm as main-app
 
-ENV PYTHONWARNINGS="ignore:::django.http.response:517"
-
 LABEL org.opencontainers.image.authors="paperless-ngx team <hello@paperless-ngx.com>"
 LABEL org.opencontainers.image.documentation="https://docs.paperless-ngx.com/"
 LABEL org.opencontainers.image.source="https://github.com/paperless-ngx/paperless-ngx"
@@ -57,6 +55,12 @@ ARG JBIG2ENC_VERSION=0.29
 ARG QPDF_VERSION=11.6.4
 ARG GS_VERSION=10.02.1
 
+# Set Python environment variables
+ENV PYTHONDONTWRITEBYTECODE=1 \
+    PYTHONUNBUFFERED=1 \
+    # Ignore warning from Whitenoise
+    PYTHONWARNINGS="ignore:::django.http.response:517"
+
 #
 # Begin installation and configuration
 # Order the steps below from least often changed to most