From bd0f6003f5d95de806db7bbc6dfb53325a845c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Sat, 12 Jul 2025 23:18:53 +0200 Subject: [PATCH] healthcheck w docker-compose --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 65e4333..ce6e0ac 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: ports: - "${APP_PORT:-8000}:8000" healthcheck: - test: ["CMD", "curl", "-f", "-H", "X-Internal-Check: ${HEALTHCHECK_TOKEN}", "http://localhost:8000/healthcheck"] + test: ["CMD", "python", "-c", "import urllib.request; import sys; req = urllib.request.Request('http://localhost:8000/healthcheck', headers={'X-Internal-Check': '${HEALTHCHECK_TOKEN}'}); sys.exit(0) if urllib.request.urlopen(req).read() == b'OK' else sys.exit(1)"] interval: 30s timeout: 10s retries: 3