Skip to content

Commit 4869b84

Browse files
sntiwari1claude
andcommitted
Fix ClickHouse health check: use clickhouse-client instead of wget on port 8123
BusyBox wget in the clickhouse alpine image exits 0 even on connection refused, making the health check always pass (false positive). Additionally, port 8123 (HTTP interface) is not exposed by this image -- only port 9000 (native protocol). Replace with: clickhouse-client --query "SELECT 1" 2>/dev/null | grep -q "^1" This correctly exits 1 when the server is unavailable and 0 when ready. Also halve the interval (30s->15s) and double retries (10->20) so Docker has more attempts within the same total window before marking the container unhealthy. Verified locally: container reaches (healthy) status within 35 seconds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent adc84ed commit 4869b84

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

docker-compose-v1.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,10 @@ services:
382382
ports:
383383
- '9002:9000'
384384
healthcheck:
385-
test: ['CMD-SHELL', 'wget -nv -t1 --spider http://localhost:8123/ping || exit 1']
386-
interval: 30s
385+
test: ['CMD-SHELL', 'clickhouse-client --query "SELECT 1" 2>/dev/null | grep -q "^1"']
386+
interval: 15s
387387
timeout: 10s
388-
retries: 10
388+
retries: 20
389389
start_period: 30s
390390
id-gen-service:
391391
image: ghcr.io/sunbird-rc/id-gen-service:${RELEASE_VERSION}

0 commit comments

Comments
 (0)