ubiquitous-invention/docker
Randall Stillwell d4e4f9dbf0 fix(docker): serialize build stages so next build doesn't OOM on the 8 GB host
Coolify deploys were failing with exit 255 (kernel OOM, no Docker error)
around the 73s mark of `next build`. Root cause: docker/Dockerfile's three
build stages (web-build, collab-build, mcp-build) all `FROM deps`, and
BuildKit was running them in parallel. The web-build alone wants ~3 GB
heap (capped at 5120 MB) and was racing tsup workers + buildkit + dockerd
on an 8 GB host until the kernel reaped it.

docker-compose.coolify.yml already had a comment claiming `depends_on:
[collab, mcp]` on `web` would serialize the builds. It doesn't —
`depends_on` only orders runtime startup, not `docker compose build`.

Fix: enforce ordering inside the Dockerfile DAG by COPYing one trivial
artifact from each lighter stage into web-build. BuildKit now waits for
collab-build and mcp-build to finish before starting the heavy Next.js
compile, which then gets the host effectively to itself. The copied
files land in /tmp and are never read by the runtime web image.

Also updated the compose comment to reflect the new (and accurate)
ordering mechanism.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 21:02:39 -05:00
..
.dockerignore feat: Full project management application scaffold 2026-03-26 22:39:16 -05:00
docker-compose.coolify.yml fix(docker): serialize build stages so next build doesn't OOM on the 8 GB host 2026-06-05 21:02:39 -05:00
docker-compose.dev.yml feat: Full project management application scaffold 2026-03-26 22:39:16 -05:00
docker-compose.yml docker: unify per-service Dockerfiles into one multi-stage file 2026-04-27 14:38:39 -05:00
Dockerfile fix(docker): serialize build stages so next build doesn't OOM on the 8 GB host 2026-06-05 21:02:39 -05:00
next.config.docker.ts docker: skip type-check + lint during prod web build 2026-04-27 14:58:12 -05:00