From 94fb410c59fb134ba4167e0acf56563eb81679cc Mon Sep 17 00:00:00 2001 From: Vassiliy Yegorov Date: Tue, 28 Jul 2026 11:50:02 +0700 Subject: [PATCH] Fix postgres healthcheck probing a nonexistent database pg_isready without -d connects to a database named after the user, but the database is imapcopier, so every probe logged a FATAL and the healthcheck only passed because pg_isready treats "server rejects the connection" as reachable. Co-Authored-By: Claude Opus 5 (1M context) --- docker-compose-traefik.yml | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose-traefik.yml b/docker-compose-traefik.yml index 468314f..da7ad43 100644 --- a/docker-compose-traefik.yml +++ b/docker-compose-traefik.yml @@ -8,7 +8,7 @@ services: volumes: - pgdata:/var/lib/postgresql healthcheck: - test: ["CMD-SHELL", "pg_isready -U imap"] + test: ["CMD-SHELL", "pg_isready -U imap -d imapcopier"] interval: 5s timeout: 3s retries: 5 diff --git a/docker-compose.yml b/docker-compose.yml index dbd63e0..cda996b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: volumes: - pgdata:/var/lib/postgresql healthcheck: - test: ["CMD-SHELL", "pg_isready -U imap imapcopier"] + test: ["CMD-SHELL", "pg_isready -U imap -d imapcopier"] interval: 5s timeout: 3s retries: 5