From 9a32cdb1b33af788c3242200b685243cceb23672 Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Sun, 29 Mar 2026 09:31:53 +0000 Subject: [PATCH] fix: cap Node.js heap to prevent OOM during wgc composition (#788) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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: https://gitea.unbound.se/unboundsoftware/schemas/pulls/788 --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 71e02e2..e1e0551 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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/