Merge pull request #2099 from ariarijp/fix/create_db

Fix create_db command of docker-entrypoint
This commit is contained in:
Arik Fraimovich
2018-02-11 15:48:56 +02:00
committed by GitHub

View File

@@ -22,6 +22,14 @@ server() {
exec /usr/local/bin/gunicorn -b 0.0.0.0:5000 --name redash -w${REDASH_WEB_WORKERS:-4} redash.wsgi:app
}
create_db() {
while ! bash -c "echo > /dev/tcp/postgres/5432" &> /dev/null ; do
echo "Waiting for PostgreSQL container to become available."
sleep 5
done
exec /app/manage.py database create_tables
}
help() {
echo "Redash Docker."
echo ""
@@ -70,7 +78,7 @@ case "$1" in
exec /app/manage.py shell
;;
create_db)
exec /app/manage.py database create_tables
create_db
;;
manage)
shift