Add a config option for the postgres database port

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2023-10-02 20:27:47 +02:00 committed by Simon L.
parent d8a73f8786
commit 047c3555ba
7 changed files with 46 additions and 7 deletions

View file

@ -1,6 +1,14 @@
#!/bin/bash
nc -z "$POSTGRES_HOST" 5432 || exit 0
# Set a default value for POSTGRES_PORT
if [ -z "$POSTGRES_PORT" ]; then
POSTGRES_PORT=5432
fi
# POSTGRES_HOST must be set in the containers env vars and POSTGRES_PORT has a default above
# shellcheck disable=SC2153
nc -z "$POSTGRES_HOST" "$POSTGRES_PORT" || exit 0
if ! nc -z localhost 9000; then
exit 1