fix: upgrade Docker base to python:3.13-slim (29 Snyk findings)#7
fix: upgrade Docker base to python:3.13-slim (29 Snyk findings)#7ryanmcmillan merged 2 commits intomainfrom
Conversation
Resolves 29 Snyk findings (3 medium, 26 low) from OS-level CVEs in the python:3.11-slim Debian base image. Tested: all backend imports and 43 FastAPI routes load successfully on Python 3.14 (superset of 3.13 compat).
Greptile SummaryThis PR makes a single-line change, bumping the Docker base image from Key changes:
Notes:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Registry as Docker Hub
participant Build as docker build
participant Container as Running Container
Dev->>Build: docker build .
Build->>Registry: Pull python:3.13-slim (was 3.11-slim)
Registry-->>Build: Debian base + Python 3.13 runtime
Build->>Build: COPY backend/requirements.txt
Build->>Build: pip install -r requirements.txt
Build->>Build: COPY backend/ source
Build-->>Dev: Image ready
Dev->>Container: docker run
Container->>Container: Run migrations (001→005)
Container->>Container: python backend/main.py (uvicorn)
Container-->>Dev: 43 FastAPI routes live on :18890
Last reviewed commit: "fix: upgrade Docker ..." |
Dockerfile
Outdated
| @@ -1,4 +1,4 @@ | |||
| FROM python:3.11-slim | |||
| FROM python:3.13-slim | |||
There was a problem hiding this comment.
Floating image tag reduces build reproducibility
python:3.13-slim is a mutable tag — Docker will re-pull whatever 3.13-slim resolves to at build time, which can silently change across builds as patch releases are published (e.g. 3.13.1 → 3.13.2). For a more reproducible, security-auditable image, consider either pinning to the minor patch version or to a digest:
| FROM python:3.13-slim | |
| FROM python:3.13.3-slim |
or, for strongest guarantees:
FROM python:3.13-slim@sha256:<current-digest>
This is already the approach needed to prevent the same class of "base image drifted" Snyk findings from reappearing in the future.
Per Greptile review — pin to exact patch version for reproducible builds and audit trail.
Summary
Upgrades the Docker base image from
python:3.11-slimtopython:3.13-slimto resolve 29 OS-level Snyk findings (3 medium, 26 low) from the Debian base.Testing
pip installdeps compile cleanly (including scikit-learn/numpy C extensions)What this fixes
The 29 findings are all from Debian packages in the
python:3.11-slimimage (systemd, apt, openssl, etc). Bumping to 3.13-slim gets a newer Debian with patched OS packages.