Skip to content

Commit

Permalink
Use autoheal
Browse files Browse the repository at this point in the history
  • Loading branch information
richardr1126 committed Jan 16, 2025
1 parent 3103914 commit 14bcd74
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ services:
tty: true
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "health_check.py"]
interval: 60s
timeout: 10s
retries: 3
start_period: 60s
test: ["CMD", "python", "health_check.py"] # Command to check the container's health
interval: 60s # Time between each health check
timeout: 10s # Time allowed for the health check to complete
retries: 2 # Number of failed health checks before marking as unhealthy
start_period: 60s # Grace period before starting health checks after container starts
depends_on:
- postgres

labels:
- autoheal_firehose=true # Label to enable auto-healing for this container

scheduler:
container_name: scheduler
image: richardr1126/cosmere-db-scheduler
Expand Down Expand Up @@ -58,5 +60,16 @@ services:
depends_on:
- postgres

autoheal:
deploy:
replicas: 1
image: willfarrell/autoheal:latest
container_name: autoheal
restart: unless-stopped
environment:
- AUTOHEAL_CONTAINER_LABEL=autoheal_firehose # Label to specify which containers to monitor
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Allows access to Docker daemon to restart containers

volumes:
dbdata:

0 comments on commit 14bcd74

Please sign in to comment.