mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
Fix docker-entrypoint broke for Other name than "postgres"
This commit is contained in:
@@ -23,7 +23,16 @@ server() {
|
||||
}
|
||||
|
||||
create_db() {
|
||||
while ! bash -c "echo > /dev/tcp/postgres/5432" &> /dev/null ; do
|
||||
DATABASE_FULLURL=$(echo $REDASH_DATABASE_URL |cut -d '@' -f2 |sed 's,/.*,,g')
|
||||
|
||||
if [[ $DATABASE_FULLURL = *":"* ]]; then
|
||||
DATABASE_URL=$(echo $DATABASE_FULLURL |cut -d ':' -f1)
|
||||
DATABASE_PORT=$(echo $DATABASE_FULLURL |cut -d ':' -f2)
|
||||
else
|
||||
DATABASE_URL=$(echo $DATABASE_FULLURL)
|
||||
DATABASE_PORT="5432"
|
||||
fi
|
||||
while ! bash -c "echo > /dev/tcp/$DATABASE_URL/$DATABASE_PORT" &> /dev/null ; do
|
||||
echo "Waiting for PostgreSQL container to become available."
|
||||
sleep 5
|
||||
done
|
||||
@@ -97,3 +106,4 @@ case "$1" in
|
||||
exec "$@"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user