Files
books/wrapper.sh

16 lines
514 B
Bash
Executable File

#!/bin/bash
if [ "$FLASK_ENV" == "production" ]; then
export WORKERS=2
export THREADS=2
else
cd /pybook_mapped_volume
export WORKERS=1
export THREADS=1
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 --enable-stdio-inheritance
# just in case it fails this keeps the container up so you can check gunicorn logs
sleep 99999