From 7b59b6a60ddc40f1bdbec33ff6dfa67916c4eb1b Mon Sep 17 00:00:00 2001 From: Tomas Kracmar Date: Sun, 5 Oct 2025 14:25:49 +0200 Subject: [PATCH] Moving python to virtual env --- app/Dockerfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index 9d151fc..845bcdd 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -26,17 +26,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ poppler-utils \ && rm -rf /var/lib/apt/lists/* +# Create an isolated Python environment to avoid PEP 668 restrictions +RUN python3 -m venv /opt/venv +ENV PATH="/opt/venv/bin:${PATH}" + WORKDIR /app # Upgrade pip toolchain then install Python deps COPY requirements.txt . -RUN python3 -m pip install --upgrade pip setuptools wheel \ - && pip3 install --no-cache-dir -r requirements.txt \ - && pip3 check || true +RUN python -m pip install --upgrade pip setuptools wheel \ + && pip install --no-cache-dir -r requirements.txt \ + && pip check || true # App code COPY app.py worker.py scanner.py ./ -RUN pip3 install --no-cache-dir gunicorn==22.0.0 +RUN pip install --no-cache-dir gunicorn==22.0.0 # Healthcheck against the app's /health endpoint