Skip to content

fix: stop migrate image from building the frontend - #1

Merged
m3hrdadfi merged 1 commit into
mainfrom
hotfix/migrate-build-frontend-dep
Aug 26, 2026
Merged

fix: stop migrate image from building the frontend#1
m3hrdadfi merged 1 commit into
mainfrom
hotfix/migrate-build-frontend-dep

Conversation

@m3hrdadfi

Copy link
Copy Markdown
Owner

Bug

`docker compose up --build` intermittently failed with:

target migrate: failed to solve: process "/bin/sh -c npm ci" did not complete successfully: exit code: 139

Root cause

The migrate service built from the same Dockerfile/target as proxy, which meant building migrate also compiled the entire React frontend (node:22-alpinenpm cinpm run build) — even though migrate only runs Alembic migrations and never touches the compiled frontend.

docker compose up --build builds migrate, proxy, and supabase-studio-gateway concurrently while pulling 7 base images at the same time. Under that combined load, npm ci running inside node:22-alpine (musl libc) segfaulted (exit 139). Confirmed this is a resource-contention flake, not a broken lockfile: the identical npm ci succeeds cleanly every time when run standalone, outside the concurrent build.

Fix

Split the Dockerfile into an app-runtime stage (Python venv + app code + migrations, no Node.js at all) and a proxy stage that extends it with the compiled frontend. migrate now targets app-runtime directly, so it never triggers the Node/npm build — removing an entire unnecessary, resource-heavy stage from the concurrent build graph.

Verified: docker compose build migrate now shows zero Node/npm steps, docker compose build proxy still ships frontend/dist correctly, and docker compose up -d brings the full stack up healthy end-to-end.

Test plan

  • docker compose build migrate — no frontend-builder steps
  • docker compose build proxy — frontend assets present in image
  • docker compose up -d — all 8 services healthy, /health returns ok

@m3hrdadfi
m3hrdadfi merged commit e20905f into main Aug 26, 2026
2 checks passed
@m3hrdadfi
m3hrdadfi deleted the hotfix/migrate-build-frontend-dep branch August 26, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant