Created
January 4, 2019 13:25
-
-
Save ryanpadilha/3c2e5472779e08c7426c2cc1b92c5cb5 to your computer and use it in GitHub Desktop.
This script start python application using Gunicorn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script start python application using Gunicorn | |
set -e # if occur any error, exit | |
function to_console { | |
echo -e "\n*** $1 ***\n" | |
} | |
cd $(dirname $0) && cd .. && cd .. && cd .. | |
to_console "activate virtual environment sandbox" | |
source venv-sandbox/bin/activate | |
PID=/var/named/run/gunicorn-demo-alclaudius.pid | |
if [ -f $PID ]; then rm $PID; fi | |
to_console "start python application" | |
exec gunicorn -w 3 --bind=0.0.0.0:9001 --user=ubuntu --log-level=debug --pid=$PID --log-file=/var/named/logs/demo.alclaudius.com.br/gunicorn.log 2>>/var/named/logs/demo.alclaudius.com.br/gunicorn.log 'wsgi:application(mode="demo")' & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment