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:
@@ -12,6 +12,8 @@ services:
|
|||||||
command: dotnet run --project src/BigRegister.Api --urls http://+:5000
|
command: dotnet run --project src/BigRegister.Api --urls http://+:5000
|
||||||
environment:
|
environment:
|
||||||
- ASPNETCORE_ENVIRONMENT=Development
|
- ASPNETCORE_ENVIRONMENT=Development
|
||||||
|
# ponytail: Server GC makes one heap per CPU (22 here); workstation GC makes one.
|
||||||
|
- DOTNET_gcServer=0
|
||||||
volumes:
|
volumes:
|
||||||
# ':z' relabels for SELinux (Fedora/RHEL); harmless on other hosts.
|
# ':z' relabels for SELinux (Fedora/RHEL); harmless on other hosts.
|
||||||
# WP-22: no separate volume needed for the SQLite file — `dotnet run` sets
|
# 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.
|
# 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"
|
command: sh -c "npm ci --no-fund --loglevel=error && npx ng build ssp --configuration development --localize && node scripts/serve-i18n.mjs"
|
||||||
environment:
|
environment:
|
||||||
|
# ponytail: without a cgroup limit Node sizes its heap from host RAM (16 GB).
|
||||||
|
- NODE_OPTIONS=--max-old-space-size=2048
|
||||||
- PORT=4200
|
- PORT=4200
|
||||||
- API_PROXY_TARGET=http://api:5000
|
- API_PROXY_TARGET=http://api:5000
|
||||||
- APP_DIST_ROOT=dist/ssp/browser
|
- APP_DIST_ROOT=dist/ssp/browser
|
||||||
@@ -57,6 +61,8 @@ services:
|
|||||||
working_dir: /app
|
working_dir: /app
|
||||||
command: sh -c "npm ci --no-fund --loglevel=error && npx ng build behandelportal --configuration development --localize && node scripts/serve-i18n.mjs"
|
command: sh -c "npm ci --no-fund --loglevel=error && npx ng build behandelportal --configuration development --localize && node scripts/serve-i18n.mjs"
|
||||||
environment:
|
environment:
|
||||||
|
# ponytail: without a cgroup limit Node sizes its heap from host RAM (16 GB).
|
||||||
|
- NODE_OPTIONS=--max-old-space-size=2048
|
||||||
- PORT=4201
|
- PORT=4201
|
||||||
- API_PROXY_TARGET=http://api:5000
|
- API_PROXY_TARGET=http://api:5000
|
||||||
- APP_DIST_ROOT=dist/behandelportal/browser
|
- APP_DIST_ROOT=dist/behandelportal/browser
|
||||||
|
|||||||
Reference in New Issue
Block a user