feat(infra): add cpu and memory limits to all services

This commit is contained in:
kk10
2026-10-18 11:37:52 +03:00
parent 847500013b
commit ebfef7289a
2 changed files with 22 additions and 0 deletions
+3
View File
@@ -13,3 +13,6 @@ CACHE_URL_FILE=/run/secrets/cache_url
API_REPLICAS=2
IDEMPOTENCY_TTL_SECONDS=86400
API_CPUS=0.5
API_MEM=256M
+19
View File
@@ -11,6 +11,10 @@ services:
- cache_url
deploy:
replicas: ${API_REPLICAS:-2}
resources:
limits:
cpus: "${API_CPUS:-0.5}"
memory: ${API_MEM:-256M}
depends_on:
migrate:
condition: service_completed_successfully
@@ -33,6 +37,11 @@ services:
interval: 5s
timeout: 3s
retries: 10
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
restart: unless-stopped
migrate:
@@ -54,6 +63,11 @@ services:
interval: 5s
timeout: 3s
retries: 10
deploy:
resources:
limits:
cpus: "0.25"
memory: 128M
restart: unless-stopped
load_balancer:
@@ -62,6 +76,11 @@ services:
- "127.0.0.1:8080:8080"
volumes:
- ./deploy/nginx.conf:/etc/nginx/nginx.conf:ro
deploy:
resources:
limits:
cpus: "0.5"
memory: 128M
depends_on:
api:
condition: service_healthy