Add resource limits to all Docker containers
- fail2ban: 0.5 CPU / 128M memory limit, 0.1 CPU / 64M reserved - backend: 2.0 CPU / 512M memory limit, 1.0 CPU / 256M reserved - frontend: 0.5 CPU / 128M memory limit, 0.25 CPU / 64M reserved Prevents 'noisy neighbor' scenarios where one container exhausts host resources (CPU, memory, disk). Limits are hard caps; reservations guarantee minimum allocation to prevent OOM kills and ensure responsive service even under load. Fixes resource contention issue in production and staging environments. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -26,6 +26,13 @@ services:
|
||||
#- /path/to/unificontroller/log:/remotelogs/unificontroller:ro #optional
|
||||
#- /path/to/vaultwarden/log:/remotelogs/vaultwarden:ro #optional
|
||||
restart: unless-stopped
|
||||
deploy:
|
||||
limits:
|
||||
cpus: '0.5'
|
||||
memory: 128M
|
||||
reservations:
|
||||
cpus: '0.1'
|
||||
memory: 64M
|
||||
|
||||
backend:
|
||||
image: git.lpl-mind.de/lukas.pupkalipinski/bangui/backend:latest
|
||||
@@ -53,6 +60,13 @@ services:
|
||||
- "8000"
|
||||
networks:
|
||||
- bangui-net
|
||||
deploy:
|
||||
limits:
|
||||
cpus: '2'
|
||||
memory: 512M
|
||||
reservations:
|
||||
cpus: '1'
|
||||
memory: 256M
|
||||
|
||||
# ── Frontend (nginx serving built SPA + API proxy) ──────────
|
||||
frontend:
|
||||
@@ -69,6 +83,13 @@ services:
|
||||
condition: service_started
|
||||
networks:
|
||||
- bangui-net
|
||||
deploy:
|
||||
limits:
|
||||
cpus: '0.5'
|
||||
memory: 128M
|
||||
reservations:
|
||||
cpus: '0.25'
|
||||
memory: 64M
|
||||
|
||||
networks:
|
||||
bangui-net:
|
||||
|
||||
Reference in New Issue
Block a user