From d75d5438a3f58f3ea4a19b2a73238fcf3c00d37a Mon Sep 17 00:00:00 2001 From: cppla <i@cpp.la> Date: Wed, 3 Apr 2024 17:44:43 +0800 Subject: [PATCH] docker compose healthcheck --- docker-compose.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 4701199..5b935d2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,11 @@ services: context: . dockerfile: Dockerfile image: serverstatus_server + healthcheck: + test: curl --fail http://localhost:80 || bash -c 'kill -s 15 -1 && (sleep 10; kill -s 9 -1)' + interval: 30s + timeout: 10s + retries: 5 container_name: serverstatus restart: unless-stopped networks: