cr-connect-workflow/docker_run.sh

26 lines
571 B
Bash
Raw Normal View History

#!/bin/bash
# run migrations
2020-05-25 04:47:49 +00:00
export FLASK_APP=/app/crc/__init__.py
2020-04-21 23:37:56 +00:00
if [ "$DOWNGRADE_DB" = "true" ]; then
echo 'Downgrading database...'
2020-04-21 23:37:56 +00:00
pipenv run flask db downgrade
fi
if [ "$UPGRADE_DB" = "true" ]; then
echo 'Upgrading database...'
pipenv run flask db upgrade
fi
if [ "$RESET_DB" = "true" ]; then
echo 'Resetting database...'
pipenv run flask load-example-data
fi
2020-05-25 15:41:53 +00:00
if [ "$APPLICATION_ROOT" = "/" ]; then
2020-05-25 16:26:17 +00:00
pipenv run gunicorn --bind 0.0.0.0:$PORT0 wsgi:app
2020-05-25 15:41:53 +00:00
else
pipenv run gunicorn -e SCRIPT_NAME="$APPLICATION_ROOT" --bind 0.0.0.0:$PORT0 wsgi:app
fi