From cc6a423ef0ce4a5183818a7a3f8c7488bbf8e41f Mon Sep 17 00:00:00 2001 From: Adam French Date: Tue, 14 Apr 2026 10:59:48 +0100 Subject: [PATCH] Add backend healthcheck and autoheal for automatic restart 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 --- docker-compose.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index b2c895d..f0187c2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -79,6 +79,23 @@ services: - ./logs:/backend/logs - uploads:/backend/uploads - ./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: image: postgres:16