forked from mtusi2026/mtusi2026lab3
feat-(overloaded pool 503 added)
This commit is contained in:
+24
-6
@@ -12,11 +12,20 @@ services:
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ./infra/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./infra/nginx.conf.template:/etc/nginx/templates/nginx.conf.template:ro
|
||||
environment:
|
||||
- NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx
|
||||
- KEEPALIVE_DIRECTIVE=${KEEPALIVE_DIRECTIVE:-}
|
||||
- PROXY_HTTP_VERSION_DIRECTIVE=${PROXY_HTTP_VERSION_DIRECTIVE:-}
|
||||
- PROXY_CONNECTION_DIRECTIVE=${PROXY_CONNECTION_DIRECTIVE:-}
|
||||
depends_on:
|
||||
api:
|
||||
condition:
|
||||
service_healthy
|
||||
condition: service_healthy
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '${NGINX_CPU:-1.0}'
|
||||
memory: ${NGINX_MEM:-256M}
|
||||
restart: unless-stopped
|
||||
api:
|
||||
build: .
|
||||
@@ -27,6 +36,10 @@ services:
|
||||
- SESSION_TTL_SECONDS=${SESSION_TTL_SECONDS}
|
||||
- REDIS_URL=${REDIS_URL}
|
||||
- INSTANCE_ID_PREFIX=api
|
||||
- DB_POOL_SIZE=${DB_POOL_SIZE:-10}
|
||||
- DB_MAX_OVERFLOW=${DB_MAX_OVERFLOW:-20}
|
||||
- DB_POOL_TIMEOUT=${DB_POOL_TIMEOUT:-30}
|
||||
- DB_POOL_RECYCLE=${DB_POOL_RECYCLE:-3600}
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
@@ -42,11 +55,11 @@ services:
|
||||
start_period: 15s
|
||||
retries: 3
|
||||
deploy:
|
||||
replicas: 2
|
||||
replicas: ${API_REPLICAS:-2}
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.5'
|
||||
memory: 512M
|
||||
cpus: '${API_CPU:-1.0}'
|
||||
memory: ${API_MEM:-512M}
|
||||
|
||||
postgres:
|
||||
image: postgres:16.3-alpine
|
||||
@@ -75,6 +88,11 @@ services:
|
||||
- "127.0.0.1:6379:6379"
|
||||
volumes:
|
||||
- redisdata:/data
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '${REDIS_CPU:-0.5}'
|
||||
memory: ${REDIS_MEM:-256M}
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 5s
|
||||
|
||||
Reference in New Issue
Block a user