diff --git a/docker-compose.yml b/docker-compose.yml index ce5c283fb..74d345791 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,7 +21,7 @@ sapldb: - "5532:5432" web: build: . - command: /bin/sh -c "/bin/sh busy-wait.sh && python3 manage.py bower install && python3 manage.py migrate && /bin/sh gunicorn_start.sh" + command: /bin/sh -c "/bin/sh busy-wait.sh && python3 manage.py bower install && python3 manage.py migrate && /bin/sh gunicorn_start.sh /sapl" volumes: - .:/sapl links: diff --git a/gunicorn_start.sh b/gunicorn_start.sh index aebd45c83..ebbae1725 100755 --- a/gunicorn_start.sh +++ b/gunicorn_start.sh @@ -2,9 +2,18 @@ # As seen in http://tutos.readthedocs.org/en/latest/source/ndg.html +SAPL_DIR=/var/interlegis/sapl + +# Seta um novo diretório foi passado como raiz para o SAPL +# caso esse tenha sido passado como parâmetro +if [ "$1" ] +then + SAPL_DIR="$1" +fi + NAME="SAPL" # Name of the application (*) -DJANGODIR=/sapl/ # Django project directory (*) -SOCKFILE=/sapl/run/gunicorn.sock # we will communicate using this unix socket (*) +DJANGODIR=$SAPL_DIR # Django project directory (*) +SOCKFILE=$SAPL_DIR/gunicorn.sock # we will communicate using this unix socket (*) USER=`whoami` # the user to run as (*) GROUP=`whoami` # the group to run as (*) NUM_WORKERS=3 # how many worker processes should Gunicorn spawn (*)