From ddbeff7d7e96c2cf0ad58c62bdd33ead76bf79f9 Mon Sep 17 00:00:00 2001 From: xbgmsharp Date: Wed, 1 Feb 2023 23:59:22 +0100 Subject: [PATCH] Add docker healthy check for PostgreSQL --- docker-compose.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 36a5c13..56c807c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,6 +18,12 @@ services: logging: options: max-size: 10m + healthcheck: + test: ["CMD-SHELL", "sh -c 'pg_isready -U ${POSTGRES_USER} -d signalk'"] + interval: 60s + timeout: 30s + retries: 5 + start_period: 100s api: image: postgrest/postgrest