Add start file to automatically kick off server

This commit is contained in:
Sage Vaillancourt 2021-07-28 22:52:37 -04:00
parent 2f773098d5
commit e71c9814a1
1 changed files with 17 additions and 0 deletions

17
start Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
if ! pip -V | grep "$SCRIPT_DIR/venv"; then
echo "Entering virtual environment..."
source $SCRIPT_DIR/venv/bin/activate
fi
if [[ "$1" == "prod" ]]; then
echo "Starting gunicorn production server..."
gunicorn -b 0.0.0.0:6969 "flaskr:create_app()"
else
echo "Starting local dev server..."
export FLASK_ENV=development
export FLASK_APP=flaskr
flask run --host=0.0.0.0
fi