Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ RUN apt-get update && \
apt-get remove --purge -y --auto-remove perl libperl* && \
rm -rf /var/lib/apt/lists/*

# Drop ensurepip's bundled setuptools/pip wheels — unused at runtime (nothing
# in this image creates a venv) but their frozen versions still trip Trivy
# (e.g. CVE-2025-47273) even after the site-packages copy is patched below.
RUN rm -f /usr/local/lib/python3.*/ensurepip/_bundled/*.whl

WORKDIR /app

# ── deps layer (cached unless requirements.txt changes) ───────────────────
Expand Down Expand Up @@ -59,6 +64,13 @@ COPY --from=deps /usr/local/bin /usr/local/bin
# jaraco.context 5.3.0 for CVE-2026-23949; wheel 0.46.2+ for CVE-2026-24049).
# Don't pin pip — the base image ships 26.2.1+ and downgrading breaks imports.
RUN pip install --upgrade setuptools==83.0.0 wheel==0.46.2
# Remove pip itself — unused at runtime (entrypoint.sh only calls manage.py/
# gunicorn) and its pip/_vendor bundle carries its own frozen msgpack/setuptools
# copies that Trivy flags (GHSA-6v7p-g79w-8964, CVE-2025-47273) independent of
# the real site-packages copies patched above.
RUN rm -rf /usr/local/lib/python3.*/site-packages/pip \
/usr/local/lib/python3.*/site-packages/pip-*.dist-info \
/usr/local/bin/pip /usr/local/bin/pip3 /usr/local/bin/pip3.*
COPY . .

# Bake version into files so the runtime can read them without a .git dir
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ gunicorn==26.0.0
pytest==9.1.1
pytest-django==4.12.0
pytest-bdd==8.1.0
msgpack==1.2.1 # transitive via pytest-bdd→gherkin-official; pin for GHSA-6v7p-g79w-8964
coverage==7.15.4
pytest-asyncio==1.4.0
pytest-rerunfailures==16.5 # flaky test retry (Phase C)
Expand Down
Loading