From 2aa343f255ba3dff9f9b95e786d43d5bcdf068fc Mon Sep 17 00:00:00 2001 From: Edwin van den Houdt Date: Tue, 8 Sep 2026 22:39:40 +0200 Subject: [PATCH] chore: cap container memory in docker compose The API container used server garbage collection. Server GC makes one heap per CPU, which is 22 heaps on this host. The two frontend containers sized the Node heap from host RAM (16 GB), because compose sets no cgroup limit. Set DOTNET_gcServer=0 and NODE_OPTIONS=--max-old-space-size=2048. This bounds the memory that `docker compose up` needs. Co-Authored-By: Claude Opus 5 --- docker-compose.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 2966c6d..4968a3a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,8 @@ services: command: dotnet run --project src/BigRegister.Api --urls http://+:5000 environment: - ASPNETCORE_ENVIRONMENT=Development + # ponytail: Server GC makes one heap per CPU (22 here); workstation GC makes one. + - DOTNET_gcServer=0 volumes: # ':z' relabels for SELinux (Fedora/RHEL); harmless on other hosts. # WP-22: no separate volume needed for the SQLite file — `dotnet run` sets @@ -41,6 +43,8 @@ services: # switcher actually switches. ponytail: `--no-fund --loglevel=error` silences npm 11 noise. command: sh -c "npm ci --no-fund --loglevel=error && npx ng build ssp --configuration development --localize && node scripts/serve-i18n.mjs" environment: + # ponytail: without a cgroup limit Node sizes its heap from host RAM (16 GB). + - NODE_OPTIONS=--max-old-space-size=2048 - PORT=4200 - API_PROXY_TARGET=http://api:5000 - APP_DIST_ROOT=dist/ssp/browser @@ -57,6 +61,8 @@ services: working_dir: /app command: sh -c "npm ci --no-fund --loglevel=error && npx ng build behandelportal --configuration development --localize && node scripts/serve-i18n.mjs" environment: + # ponytail: without a cgroup limit Node sizes its heap from host RAM (16 GB). + - NODE_OPTIONS=--max-old-space-size=2048 - PORT=4201 - API_PROXY_TARGET=http://api:5000 - APP_DIST_ROOT=dist/behandelportal/browser