File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ ENV UV_LINK_MODE=copy \
1414
1515WORKDIR /app
1616
17- # Create virtual environment
18- RUN python -m venv /app/.venv
17+ # Create virtual environment (without pip — uv handles installs)
18+ RUN python -m venv --without-pip /app/.venv
1919
2020# Copy dependency files first for better layer caching
2121COPY pyproject.toml uv.lock /app/
@@ -32,11 +32,11 @@ COPY static /app/static/
3232# ##############
3333FROM python:3.12-slim-bookworm
3434
35- # Patch system packages
36- RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
37-
38- # Upgrade system pip (fixes GHSA-jp4c-xjxw-mgf9)
39- RUN pip install --no-cache-dir --upgrade pip>=26.1
35+ # Patch system packages and strip pip/setuptools (not needed at runtime)
36+ RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/* && \
37+ rm -rf /usr/local/lib/python3.12/dist-packages/pip* \
38+ /usr/local/lib/python3.12/dist-packages/setuptools* \
39+ /usr/local/bin/ pip*
4040
4141# Create non-root user
4242RUN groupadd -r app && useradd -r -d /app -g app -N app
You can’t perform that action at this time.
0 commit comments