Files
presidio/docker-compose.yml
hiro-nikaitou 526bc80d2e [Chore] Add healthcheck and restart policy to docker-compose.yml (#2149)
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) <noreply@anthropic.com>
Co-authored-by: Sharon Hart <sharonh.dev@gmail.com>
2026-07-13 10:18:47 +03:00

78 lines
2.0 KiB
YAML

services:
ollama:
image: ollama/ollama:latest
ports:
- "127.0.0.1:11434:11434" # or "127.0.0.1:11435:11434"
volumes:
- ollama-data:/root/.ollama
environment:
- OLLAMA_HOST=0.0.0.0
healthcheck:
test: ["CMD", "ollama", "list"]
interval: 10s
timeout: 10s
retries: 30 # ~5 minutes total
start_period: 60s
restart: unless-stopped
presidio-anonymizer:
image: ${REGISTRY_NAME}/${IMAGE_PREFIX}presidio-anonymizer${TAG}
build:
context: ./presidio-anonymizer
cache_from:
- type=registry,ref=${REGISTRY_NAME}/${IMAGE_PREFIX}presidio-anonymizer:latest
environment:
- 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}
build:
context: ./presidio-analyzer
cache_from:
- type=registry,ref=${REGISTRY_NAME}/${IMAGE_PREFIX}presidio-analyzer:latest
environment:
- PORT=5001
- OLLAMA_HOST=http://ollama:11434
ports:
- "5002:5001"
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}
build:
context: ./presidio-image-redactor
cache_from:
- type=registry,ref=${REGISTRY_NAME}/${IMAGE_PREFIX}presidio-image-redactor:latest
environment:
- 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: