fix: replace removed tiangolo base image with python:3.13-slim #115
No reviewers
Labels
No Label
ai-changes-requested
ai-failed
ai-pr-opened
ai-reviewed
ai-reviewing
ai-reviewing
ai-working
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-database#115
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/dockerfile-base-image"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
tiangolo/uvicorn-gunicorn-fastapi:python3.12was removed from Docker Hub, breaking CI buildspython:3.13-slimwith explicit uvicorn CMD/app/appwith WORKDIR/usr/src/app)--workers 2to replace the multi-worker gunicorn setup from the old base imageFollow-ups (not in this PR)
WORKERS_PER_CORE/TIMEOUT/GRACEFUL_TIMEOUTenv vars from docker-composelibpq-dev(not needed withpsycopg2-binary)/healthendpointTest plan
devtag, verify CI build succeeds:devimage on dev server and verify container starts/api/v3/currentto confirm app is serving🤖 Generated with Claude Code
AI Code Review
Files Reviewed
Dockerfile(modified)Findings
Correctness
Blocking:
numpy==1.26.4has no Python 3.13 wheel.requirements.txtpinsnumpy==1.26.4, which supports Python 3.9–3.12 only. NumPy 3.13 support was introduced in 2.1.0. Onpython:3.13-slim:numpy==1.26.4+ Python 3.13slimimages ship no C build toolchain (nogcc/build-essential), so source compilation will also faildocker buildfails atpip install -r requirements.txt— the CI break this PR intends to fix persists, just with a different errorpsycopg2-binary==2.9.11may also lack a Python 3.13 wheel depending on the target arch/platform, though this is secondary to the numpy issue.Fix: Change
python:3.13-slim→python:3.12-slim. This matches the Python version from the removedtiangolo/uvicorn-gunicorn-fastapi:python3.12base image and requires no changes torequirements.txt. Upgrading to 3.13 is a separate task that would require updating numpy (≥2.1) and verifying all other pinned deps.Security
Style & Conventions
COPY ./app /usr/src/app/appproperly aligns the copy destination withWORKDIR /usr/src/app, fixing the pre-existing path mismatch.CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80", "--workers", "2"]is correct —app.main:appresolves to/usr/src/app/app/main.py→app = FastAPI(...)at line 65.--workers 2is safe here because Peewee'sautoconnect=False(PR #87) ensures connections are not established before fork.Suggestions
libpq-dev, non-root user) are well-scoped — good to track separately.python:3.12-slimas the final image name to signal the Python version explicitly, or add a comment noting why 3.13 was not used yet.Verdict: REQUEST_CHANGES
The only change needed is
python:3.13-slim→python:3.12-sliminDockerfileline 2. All other changes (COPY path fix, explicit CMD) are correct and should be kept.Automated review by Claude PR Reviewer
Addressed review feedback: changed
python:3.13-slim→python:3.12-slim.numpy==1.26.4(pinned in requirements.txt) has no Python 3.13 wheel, and the slim image ships no C build toolchain, so the build would have failed atpip install.python:3.12-slimmatches the Python version from the removed tiangolo base image and requires no changes to requirements.txt.AI Code Review
Files Reviewed
Dockerfile(modified)Findings
Correctness
FROM python:3.12-slimis correct.numpy==1.26.4has no Python 3.13 wheel, so 3.12 is the right target. (PR title says "3.13-slim" but the actual diff uses 3.12-slim — stale title, correct code.)COPY ./app /usr/src/app/appcorrectly places app code at/usr/src/app/app/which aligns withWORKDIR /usr/src/appand resolvesapp.main:appin the CMD. Verified:app/main.py:65declaresapp = FastAPI(...).CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80", "--workers", "2"]is required sincepython:3.12-slimhas no built-in entrypoint; correctly replaces gunicorn's multi-worker behavior.Security
Style & Conventions
python:3.13-slimbut the implemented change ispython:3.12-slim. Functionally correct; title is just stale.Suggestions
libpq-devremoval,/healthhealthcheck, non-root user) are all valid — worth tracking as issues if not already.Verdict: COMMENT
Code is correct. COPY path fix and explicit CMD are both sound. Approved — posting as COMMENT because Gitea blocks self-approval.
Automated review by Claude PR Reviewer