mirror of
https://github.com/lingble/chatwoot.git
synced 2026-03-20 03:52:43 +00:00
chore: allow DATABASE_URL env to take presedence over individual connection params. (#1147)
fixes: #1147 Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
This commit is contained in:
@@ -8,8 +8,14 @@ rm -rf /app/tmp/cache/*
|
||||
|
||||
echo "Waiting for postgres to become ready...."
|
||||
|
||||
PGPASSWORD=$POSTGRES_PASSWORD
|
||||
PSQL="pg_isready -h $POSTGRES_HOST -p 5432 -U $POSTGRES_USERNAME"
|
||||
# Let DATABASE_URL env take presedence over individual connection params.
|
||||
if [ -z "$DATABASE_URL" ]; then
|
||||
PGPASSWORD=$POSTGRES_PASSWORD
|
||||
PSQL="pg_isready -h $POSTGRES_HOST -p 5432 -U $POSTGRES_USERNAME"
|
||||
else
|
||||
PSQL="pg_isready -d $DATABASE_URL"
|
||||
fi
|
||||
|
||||
until $PSQL
|
||||
do
|
||||
sleep 2;
|
||||
|
||||
Reference in New Issue
Block a user