Add backend healthcheck and autoheal for automatic restart
Deploy with Docker Compose / deploy (push) Successful in 19s

Adds a Docker healthcheck to the backend service (polling GET / every 30s)
and the willfarrell/autoheal container to automatically restart any unhealthy containers.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
2026-04-14 10:59:48 +01:00
co-authored by Claude Sonnet 4.6
parent 759614e92d
commit cc6a423ef0
+17
View File
@@ -79,6 +79,23 @@ services:
- ./logs:/backend/logs - ./logs:/backend/logs
- uploads:/backend/uploads - uploads:/backend/uploads
- ./icecast2/fallback_music:/backend/fallback_music - ./icecast2/fallback_music:/backend/fallback_music
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8080/"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
autoheal:
image: willfarrell/autoheal:latest
container_name: autoheal
restart: always
environment:
- AUTOHEAL_CONTAINER_LABEL=all
- AUTOHEAL_INTERVAL=30
- AUTOHEAL_START_PERIOD=60
volumes:
- /var/run/docker.sock:/var/run/docker.sock
db: db:
image: postgres:16 image: postgres:16