fix: add database name to postgres healthcheck (#203)

When POSTGRES_USER differs from POSTGRES_DB, pg_isready defaults to
connecting to a database named after the user, causing healthcheck
to fail with "database does not exist".
This commit is contained in:
Keith authored and GitHub committed 2026-03-18 22:45:24 +07:00
1 parent dc51018563
commit 74c9fdd66b
1 file changed
+1 -1
+1 -1
View File
@@ -19,7 +19,7 @@ services:
volumes:
- postgres-data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-goclaw}"]
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-goclaw} -d ${POSTGRES_DB:-goclaw}"]
interval: 5s
timeout: 5s
retries: 10