#!/usr/bin/env bash # Entrypoint script, to be called from within a Docker container. if [ -z $SKIP_ALEMBIC_MIGRATIONS ] then # Run alembic migrations, unless SKIP_ALEMBIC_MIGRATIONS is set alembic upgrade head fi # We expose the application to every interface (0.0.0.0) within the container. # Otherwise it would only be listening to the container's loopback interface, i.e. be reachable under # localhost only from within the container (and not even from the system that is hosting the container). case ${SERVER_TYPE} in "flask") flask run --host 0.0.0.0;; "uwsgi") uwsgi --http 0.0.0.0:5000 --enable-threads -w "portal:create_app()";; *) exit 1;; esac