Moving python to virtual env
This commit is contained in:
@@ -26,17 +26,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
poppler-utils \
|
poppler-utils \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& 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
|
WORKDIR /app
|
||||||
|
|
||||||
# Upgrade pip toolchain then install Python deps
|
# Upgrade pip toolchain then install Python deps
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN python3 -m pip install --upgrade pip setuptools wheel \
|
RUN python -m pip install --upgrade pip setuptools wheel \
|
||||||
&& pip3 install --no-cache-dir -r requirements.txt \
|
&& pip install --no-cache-dir -r requirements.txt \
|
||||||
&& pip3 check || true
|
&& pip check || true
|
||||||
|
|
||||||
# App code
|
# App code
|
||||||
COPY app.py worker.py scanner.py ./
|
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
|
# Healthcheck against the app's /health endpoint
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user