Reconcile Dockerfile & compose for dev/prod targets#3
Merged
Conversation
- Rewrite Dockerfile: 3 stages (base→dev→prod), drop builder stage - Switch from trixie to bookworm, add UV_NO_DEV and UV_PYTHON_DOWNLOADS=0 - Prod copies venv from dev instead of building/installing wheels - Replace volume bind mounts with develop.watch in compose - Add --reload via compose command override - Delete Dockerfile.api prototype
AlexAxthelm
requested changes
Feb 9, 2026
Collaborator
AlexAxthelm
left a comment
There was a problem hiding this comment.
I'm on board with some of the changes, but this seems like a pretty big shift. In general, I'm comfortable with a two-layer build/run paradigm, but in this case, I'm not really sold on the need for a separate dev target.
Given that we support local dev, and that python is pretty happy with working from a volume mount, I think the dev experience would be better keeping the two-layer we have (some of these changes, like non-root user, come through), and triggering a manual rebuild if we need to alter our dependencies (the message being that we should be touching the lockfile infrequently)
Contributor
Author
|
@AlexAxthelm here's the latest summary:
|
AlexAxthelm
reviewed
Feb 11, 2026
AlexAxthelm
approved these changes
Feb 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
This is mainly to address the action failure in #2. There's layered caching in the Dockerfile with
devandprodtargets. This allows us to leverage the develop spec for local development while maintaining nearly exact parity between "prod" and "dev" environment, the main difference being that "prod" won't have theuvartifacts (/uv,/uvx,/bin,/root/.cache/uv) and sets up a non-root user to actually runuvicorn.Summary
UV_NO_DEV=1andUV_PYTHON_DOWNLOADS=0for leaner, portable buildsvolumes: .:/appbind mounts withdevelop.watch(sync + rebuild rules)--reloadvia composecommand:override (Dockerfile keeps prod-safe default)Dockerfile.apiprototype (merged into main Dockerfile)makeshortcutsTest plan
docker compose build— dev target builds successfullydocker compose up --watch— API starts, db-init completes.pyfile indeployments/api/src→ uvicorn reloadspyproject.tomloruv.lock→ image rebuildsdocker build --target prod -f deployments/api/Dockerfile -t stitch-api:prod .— prod buildsdocker run --rm stitch-api:prod whoami→nonroot