fix: cap Node.js heap to prevent OOM during wgc composition (#788)
schemas / vulnerabilities (push) Successful in 1m56s
schemas / check (push) Successful in 2m46s
schemas / check-release (push) Successful in 2m53s
schemas / build (push) Successful in 6m4s
pre-commit / pre-commit (push) Successful in 6m51s
schemas / deploy-prod (push) Successful in 1m14s
Release / release (push) Successful in 1m4s

## Summary
- Sets `NODE_OPTIONS=--max-old-space-size=64` in Dockerfile to cap Node.js heap when running `wgc router compose`
- Prevents container OOMKills in memory-constrained environments (e.g. acctest with 128Mi limit)
- The wgc Node.js process was using unbounded heap, which combined with the Go service easily exceeded container memory limits during rapid schema publishing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #788
This commit was merged in pull request #788.
This commit is contained in:
2026-03-29 09:31:53 +00:00
parent 1150e82c22
commit 9a32cdb1b3
+3
View File
@@ -30,6 +30,9 @@ ENV TZ Europe/Stockholm
# Install wgc CLI globally for Cosmo Router composition
RUN npm install -g wgc@latest
# Cap Node.js heap for runtime wgc invocations to prevent OOM
ENV NODE_OPTIONS="--max-old-space-size=64"
# Copy timezone data and certificates
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/