deploy: zero-downtime rollout (2 replicas, start-first, healthchecks) for web & convex; document in runbook

This commit is contained in:
Esdras Renan 2025-10-08 18:27:07 -03:00
parent 229fdca0b9
commit 3735e0d178
2 changed files with 56 additions and 2 deletions

View file

@ -26,7 +26,13 @@ services:
RELEASE_SHA: "${RELEASE_SHA:-dev}"
deploy:
mode: replicated
replicas: 1
replicas: 2
update_config:
parallelism: 1
order: start-first
failure_action: rollback
restart_policy:
condition: any
placement:
constraints:
- node.role == manager
@ -40,6 +46,12 @@ services:
- traefik.http.services.sistema_web.loadbalancer.server.port=3000
networks:
- traefik_public
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:3000').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
interval: 10s
timeout: 3s
retries: 5
start_period: 30s
convex_backend:
image: ghcr.io/get-convex/convex-backend:latest
@ -53,7 +65,13 @@ services:
- CONVEX_SITE_ORIGIN=https://convex.esdrasrenan.com.br
deploy:
mode: replicated
replicas: 1
replicas: 2
update_config:
parallelism: 1
order: start-first
failure_action: rollback
restart_policy:
condition: any
placement:
constraints:
- node.role == manager
@ -67,6 +85,12 @@ services:
- traefik.http.services.sistema_convex.loadbalancer.server.port=3210
networks:
- traefik_public
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:3210/version >/dev/null || exit 1"]
interval: 10s
timeout: 3s
retries: 5
start_period: 20s
convex_dashboard:
image: ghcr.io/get-convex/convex-dashboard:latest