From 5b1ac0b7417e59acb7abef7e010ed18a6c6cf87b Mon Sep 17 00:00:00 2001 From: "Aaron D. Lee" Date: Tue, 31 Mar 2026 19:46:04 -0400 Subject: [PATCH] Fix Docker healthcheck hanging gunicorn workers The healthcheck tried HTTPS first (curl -fsk https://...) when HTTPS was disabled. The TLS ClientHello to a plain HTTP listener hung the sync worker indefinitely. With 2 workers, both got stuck, blocking all real HTTP requests. Fix: try HTTP first, add --max-time 3 to release quickly on failure. Compose override uses HTTP-only to match HTTPS_ENABLED=false default. Co-Authored-By: Claude Opus 4.6 (1M context) --- docker/Dockerfile | 4 ++-- docker/docker-compose.yml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 9633b1c..e835146 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -65,7 +65,7 @@ WORKDIR /app/soosef EXPOSE 35811 -HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \ - CMD curl -fsk https://localhost:35811/ || curl -fs http://localhost:35811/ || exit 1 +HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \ + CMD curl -fs --max-time 3 http://localhost:35811/ || curl -fsk --max-time 3 https://localhost:35811/ || exit 1 ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 7ac2085..bab486a 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -15,6 +15,12 @@ services: volumes: - soosef-data:/root/.soosef restart: unless-stopped + healthcheck: + test: ["CMD", "curl", "-fs", "--max-time", "3", "http://localhost:35811/"] + interval: 30s + timeout: 5s + start_period: 15s + retries: 3 deploy: resources: limits: