From 4ef1d608dee2ab8ce13290a4c1f6490464bbb226 Mon Sep 17 00:00:00 2001 From: hiro-nikaitou Date: Wed, 8 Jul 2026 09:40:37 +0800 Subject: [PATCH] [Chore] Add healthcheck and restart policy to docker-compose.yml Add healthcheck and restart: unless-stopped to all services in docker-compose.yml so containers auto-recover on crash and Docker can detect service readiness. - ollama: add restart: unless-stopped (healthcheck already existed) - presidio-anonymizer: add healthcheck + restart: unless-stopped - presidio-analyzer: add healthcheck + restart: unless-stopped - presidio-image-redactor: add healthcheck + restart: unless-stopped Closes #2050 Co-Authored-By: Claude Opus 4.8 (1M context) --- docker-compose.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index abce615a5a..f9b8547e41 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,9 @@ services: interval: 10s timeout: 10s retries: 30 # ~5 minutes total - start_period: 60s + start_period: 60s + restart: unless-stopped + presidio-anonymizer: image: ${REGISTRY_NAME}/${IMAGE_PREFIX}presidio-anonymizer${TAG} build: @@ -23,6 +25,13 @@ services: - PORT=5001 ports: - "5001:5001" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:5001/health"] + interval: 30s + timeout: 3s + start_period: 30s + retries: 3 + restart: unless-stopped presidio-analyzer: image: ${REGISTRY_NAME}/${IMAGE_PREFIX}presidio-analyzer${TAG} @@ -38,6 +47,13 @@ services: depends_on: ollama: condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:5001/health"] + interval: 30s + timeout: 3s + start_period: 30s + retries: 3 + restart: unless-stopped presidio-image-redactor: image: ${REGISTRY_NAME}/${IMAGE_PREFIX}presidio-image-redactor${TAG} @@ -49,6 +65,13 @@ services: - PORT=5001 ports: - "5003:5001" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:5001/health"] + interval: 30s + timeout: 3s + start_period: 30s + retries: 3 + restart: unless-stopped volumes: ollama-data: