#!/bin/bash if [ "$FLASK_ENV" == "production" ]; then export WORKERS=2 export THREADS=2 export RELOAD="" else cd /pybook_mapped_volume export WORKERS=1 export THREADS=1 export RELOAD="--reload" fi sudo -u pybook gunicorn --bind=0.0.0.0:80 --timeout 300 --workers=$WORKERS --threads=$THREADS main:app --env FLASK_ENV="$FLASK_ENV" --error-logfile gunicorn.error.log --access-logfile gunicorn.log --capture-output $RELOAD --enable-stdio-inheritance # just in case it fails this keeps the container up so you can check gunicorn logs sleep 99999