From d299d5461d7dbc07916f89df1e36f0a5e6a5800a Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Fri, 28 Jul 2023 17:19:13 -0400 Subject: [PATCH] Add basic health check for db container --- compose.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compose.yml b/compose.yml index 20f41e7..a73d7cb 100644 --- a/compose.yml +++ b/compose.yml @@ -87,6 +87,12 @@ services: backupbot.backup.path: "/tmp/backup/" backupbot.restore: "true" backupbot.restore.post-hook: "sh -c 'psql -U $${POSTGRES_USER} -d $${POSTGRES_DB} < ./backup.sql && rm -f ./backup.sql'" + healthcheck: + test: "pg_isready" + interval: 30s + timeout: 10s + retries: 5 + start_period: 1m volumes: postgres: codimd_uploads: