Moving python to virtual env

This commit is contained in:
2025-10-05 14:25:49 +02:00
parent c5b92ad960
commit 7b59b6a60d

View File

@@ -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