From a1ae380ffa1e12a3c5aaa882a14fd9341daadcf7 Mon Sep 17 00:00:00 2001 From: Kharec Date: Fri, 26 Dec 2025 08:12:07 +0100 Subject: [PATCH] feat: use /health to build a healthcheck in compose --- docker-compose.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 4f616a1..054079d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,6 +20,18 @@ services: - "8080:8080" environment: - REDIS_URL=redis://redis:6379 + healthcheck: + test: + [ + "CMD", + "perl", + "-MHTTP::Tiny", + "-e", + "exit(HTTP::Tiny->new->get(\"http://localhost:8080/health\")->{success}?0:1)" + ] + interval: 10s + timeout: 5s + retries: 5 depends_on: redis: condition: service_healthy