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 <noreply@anthropic.com>
This commit is contained in:
eho
2026-09-08 22:39:40 +02:00
co-authored by Claude Opus 5
parent f3e5745145
commit 2aa343f255
+6
View File
@@ -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