Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(docker): check postgres health over tcp (#121201)

Raúl Negrón-Otero8061b9e0f565
diff --git a/docker-compose.base.yml b/docker-compose.base.yml
index 6e5e0cb8971f..b6b94cf9fa9a 100644
--- a/docker-compose.base.yml
+++ b/docker-compose.base.yml
@@ -159,7 +159,8 @@ services:
POSTGRES_DB: posthog
POSTGRES_PASSWORD: posthog
healthcheck:
- test: ['CMD-SHELL', 'pg_isready -U posthog']
+ # TCP, because the entrypoint runs init scripts on a socket-only temporary server.
+ test: ['CMD-SHELL', 'pg_isready -U posthog -h 127.0.0.1']
interval: 5s
timeout: 30s
retries: 30
diff --git a/docker-compose.sandbox.yml b/docker-compose.sandbox.yml
index 678b1d0b26e5..b48172f1ae78 100644
--- a/docker-compose.sandbox.yml
+++ b/docker-compose.sandbox.yml
@@ -220,7 +220,8 @@ services:
POSTGRES_DB: posthog
POSTGRES_PASSWORD: posthog
healthcheck:
- test: ['CMD-SHELL', 'pg_isready -U posthog']
+ # TCP, because the entrypoint runs init scripts on a socket-only temporary server.
+ test: ['CMD-SHELL', 'pg_isready -U posthog -h 127.0.0.1']
interval: 5s
timeout: 30s
retries: 30