From eed5aff238841d5640ea1c0da3713f2487eb1d0e Mon Sep 17 00:00:00 2001 From: giles Date: Fri, 6 Feb 2026 22:20:00 +0000 Subject: [PATCH] Add healthcheck and start-first update for l2-server Zero-downtime deploys: new container starts and passes health check before the old one is stopped. Caddy always has a healthy backend to proxy to. Co-Authored-By: Claude Opus 4.6 --- docker-compose.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 08d9325..a744182 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,6 +49,12 @@ services: - IPFS_API=/dns/ipfs/tcp/5001 - ANCHOR_BACKUP_DIR=/data/anchors # DATABASE_URL, ARTDAG_DOMAIN, ARTDAG_USER, JWT_SECRET from .env file + healthcheck: + test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8200/')"] + interval: 10s + timeout: 5s + retries: 3 + start_period: 15s volumes: - l2_data:/data/l2 # Still needed for RSA keys - anchor_backup:/data/anchors # Persistent anchor proofs (survives DB wipes) @@ -60,6 +66,8 @@ services: - ipfs deploy: replicas: 1 + update_config: + order: start-first restart_policy: condition: on-failure placement: