Browse Source

Update gunicorn_start.sh (#3312)

corrige gunicorn_start.sh
pull/3309/head
Rogério Frá 4 years ago
committed by GitHub
parent
commit
ce5f04374b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      docker/gunicorn_start.sh

14
docker/gunicorn_start.sh

@ -11,6 +11,9 @@ then
SAPL_DIR="$1" SAPL_DIR="$1"
fi fi
#Carrega as variáveis de ambiente
export $(egrep -v '^#' $SAPL_DIR/sapl/.env | xargs)
NAME="SAPL" # Name of the application (*) NAME="SAPL" # Name of the application (*)
DJANGODIR=/var/interlegis/sapl/ # Django project directory (*) DJANGODIR=/var/interlegis/sapl/ # Django project directory (*)
SOCKFILE=/var/interlegis/sapl/run/gunicorn.sock # we will communicate using this unix socket (*) SOCKFILE=/var/interlegis/sapl/run/gunicorn.sock # we will communicate using this unix socket (*)
@ -25,6 +28,17 @@ DJANGO_WSGI_MODULE=sapl.wsgi # WSGI module name (*)
echo "Starting $NAME as `whoami` on base dir $SAPL_DIR" echo "Starting $NAME as `whoami` on base dir $SAPL_DIR"
# Ativa ambiente virtual
cd $DJANGODIR
if [ "$SAPL_VIRTUAL_ENV" ]
then
source $SAPL_VIRTUAL_ENV/bin/activate
else
source /var/interlegis/.virtualenvs/sapl/bin/activate
fi
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=$DJANGODIR:$PYTHONPATH
# Create the run directory if it doesn't exist # Create the run directory if it doesn't exist
RUNDIR=$(dirname $SOCKFILE) RUNDIR=$(dirname $SOCKFILE)
test -d $RUNDIR || mkdir -p $RUNDIR test -d $RUNDIR || mkdir -p $RUNDIR

Loading…
Cancel
Save