feat(ops): production resilience — healthchecks, restart_policy, log-rotation, --wait deploy [skip ci]

This commit is contained in:
2026-06-13 20:04:42 +02:00
parent 6cedd8410f
commit d169cbe9d5
4 changed files with 51 additions and 9 deletions
+40
View File
@@ -15,12 +15,24 @@ services:
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks: [nexus]
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
api:
build:
context: ./backend
restart: unless-stopped
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
environment:
ASPNETCORE_ENVIRONMENT: Production
ASPNETCORE_URLS: http://+:8080
@@ -40,6 +52,12 @@ services:
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8080/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
volumes:
- /opt/openclaw/data/openclaw/openclaw.json:/home/node/.openclaw/openclaw.json:ro
- /opt/openclaw/data/openclaw/workspace-iris:/mnt/workspace-iris
@@ -51,15 +69,37 @@ services:
networks:
- nexus
- openclaw_default
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
web:
build:
context: ./frontend
restart: unless-stopped
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
ports:
- "127.0.0.1:18880:80"
depends_on: [api]
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:80/ || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks: [nexus]
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
nexus: