From 3afee66aaa1a06db46aea97c29aae4e4f68b8713 Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Sat, 21 Nov 2020 20:14:48 +0100 Subject: [PATCH] updated entrypoint script to wait for postgres --- docker/docker-entrypoint.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index c6e0d1cab..dfa7cfc65 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -15,8 +15,42 @@ map_uidgid() { fi } + +wait_for_postgres() { + attempt_num=1 + max_attempts=5 + + echo "Waiting for PostgreSQL to start..." + + host="${PAPERLESS_DBHOST}" + + while !