fix: stop migrate image from building the frontend - #1
Merged
Conversation
3 tasks
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.
Bug
`docker compose up --build` intermittently failed with:
Root cause
The
migrateservice built from the same Dockerfile/target asproxy, which meant buildingmigratealso compiled the entire React frontend (node:22-alpine→npm ci→npm run build) — even thoughmigrateonly runs Alembic migrations and never touches the compiled frontend.docker compose up --buildbuildsmigrate,proxy, andsupabase-studio-gatewayconcurrently while pulling 7 base images at the same time. Under that combined load,npm cirunning insidenode:22-alpine(musl libc) segfaulted (exit 139). Confirmed this is a resource-contention flake, not a broken lockfile: the identicalnpm cisucceeds cleanly every time when run standalone, outside the concurrent build.Fix
Split the Dockerfile into an
app-runtimestage (Python venv + app code + migrations, no Node.js at all) and aproxystage that extends it with the compiled frontend.migratenow targetsapp-runtimedirectly, so it never triggers the Node/npm build — removing an entire unnecessary, resource-heavy stage from the concurrent build graph.Verified:
docker compose build migratenow shows zero Node/npm steps,docker compose build proxystill shipsfrontend/distcorrectly, anddocker compose up -dbrings the full stack up healthy end-to-end.Test plan
docker compose build migrate— no frontend-builder stepsdocker compose build proxy— frontend assets present in imagedocker compose up -d— all 8 services healthy,/healthreturns ok