docker: raise web build V8 heap to 5 GB to match 8 GB host

CT 107 bumped to 8 GB RAM. Capping the heap below the available memory
makes V8 GC-thrash near the limit and contributes to oom-kills. Set
--max-old-space-size to 5120 MB (~60% of host) so the compile has real
headroom while leaving room for kernel + dockerd + buildkit + tsup workers.

Made-with: Cursor
This commit is contained in:
Randall Stillwell 2026-04-28 13:33:46 -05:00
parent 829cbdc899
commit 3856d11944

View file

@ -52,10 +52,10 @@ COPY docker/next.config.docker.ts ./apps/web/next.config.ts
ENV NEXT_TELEMETRY_DISABLED=1 ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production ENV NODE_ENV=production
# Give the Next.js webpack compile enough V8 heap headroom on the Coolify host. # Give the Next.js webpack compile enough V8 heap headroom on the Coolify host.
# Sized to ~70% of the 4 GB host RAM so kernel + dockerd + concurrent runtime # Sized to ~60% of an 8 GB host so kernel + dockerd + buildkit + concurrent
# COPYs from collab/mcp still have breathing room. Below ~2 GB, the compile # tsup workers still have breathing room. Below ~3 GB the compile spirals
# spirals into GC churn and gets oom-killed (exit 255 with no Docker error). # into GC churn and gets oom-killed (exit 255 with no Docker error).
ENV NODE_OPTIONS=--max-old-space-size=2560 ENV NODE_OPTIONS=--max-old-space-size=5120
RUN pnpm exec turbo build --filter=@tasks/web RUN pnpm exec turbo build --filter=@tasks/web