Build the image in two stages on Python 3.13 #147

Closed
CrowderSoup wants to merge 0 commits from claude/dockerfile-py313 into main
Owner

vTodo task #688.

  • Dockerfile is now a two-stage python:3.13.16-slim-bookworm build like vJournal/vPages/vHub: uv sync --locked --no-dev with UV_COMPILE_BYTECODE=1 in the build stage, and the runtime stage gets only /app. There's no gcc or libpq-dev in it; psycopg[binary] brings its own libpq. vTodo was already on psycopg 3, so the only dependency change is Python.
  • CMD runs python manage.py migrate and uvicorn from the venv on PATH, with no uv run. The worker role's cmd is now plain celery … because uv isn't in the runtime image. #686 removes that role anyway.
  • Python 3.13: .python-version, requires-python, uv.lock, README.
  • .dockerignore stops a local docker build . from copying the host .venv over the built one. Kamal builds from a clean clone.

Checked locally

  • pytest: 964 passed on 3.13.15, using SQLite like CI. makemigrations --check reports no changes.
  • Image: 452 MB. No gcc. Runs as app. psycopg.pq.__impl__ == "binary".
  • Container boot to /up/ 200 took about 5.8 s, including a migrate on an empty DB. Hashed static files and /login/ return 200.

The Kamal deploy boot time on the droplet can only be checked once this deploys.

🤖 Generated with Claude Code

vTodo task #688. - `Dockerfile` is now a two-stage `python:3.13.16-slim-bookworm` build like vJournal/vPages/vHub: `uv sync --locked --no-dev` with `UV_COMPILE_BYTECODE=1` in the build stage, and the runtime stage gets only `/app`. There's no `gcc` or `libpq-dev` in it; `psycopg[binary]` brings its own libpq. vTodo was already on psycopg 3, so the only dependency change is Python. - `CMD` runs `python manage.py migrate` and `uvicorn` from the venv on `PATH`, with no `uv run`. The worker role's `cmd` is now plain `celery …` because uv isn't in the runtime image. #686 removes that role anyway. - Python 3.13: `.python-version`, `requires-python`, `uv.lock`, README. - `.dockerignore` stops a local `docker build .` from copying the host `.venv` over the built one. Kamal builds from a clean clone. **Checked locally** - `pytest`: 964 passed on 3.13.15, using SQLite like CI. `makemigrations --check` reports no changes. - Image: 452 MB. No `gcc`. Runs as `app`. `psycopg.pq.__impl__ == "binary"`. - Container boot to `/up/` 200 took about 5.8 s, including a migrate on an empty DB. Hashed static files and `/login/` return 200. The Kamal deploy boot time on the droplet can only be checked once this deploys. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
CrowderSoup closed this pull request 2026-12-01 23:16:12 +00:00
All checks were successful
tests / pytest (push) Successful in 1m20s
deploy / deploy (push) Successful in 2m20s

Pull request closed

Sign in to join this conversation.
No description provided.