From ca7a7c61472a3ce59d9da859f8ebc24cf17cb40d Mon Sep 17 00:00:00 2001 From: Edward Date: Mon, 9 Oct 2017 19:25:56 -0300 Subject: [PATCH] Adiciona logs a gunicorn (#1526) --- Dockerfile | 3 ++- gunicorn_start.sh | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 42ed97c71..cb4713a31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,7 @@ RUN apk add --no-cache python3 nginx tzdata && \ rm -f /etc/nginx/conf.d/* RUN mkdir -p /var/interlegis/sapl && \ + mkdir /var/log/gunicorn \ apk add --update --no-cache $BUILD_PACKAGES && \ npm install -g bower && \ npm cache clean @@ -41,7 +42,7 @@ RUN python3 manage.py bower_install -- --allow-root --no-input && \ python3 manage.py compilescss RUN python3 manage.py collectstatic --noinput --clear - + # Remove .env(fake) e sapl.db da imagem RUN rm -rf /var/interlegis/sapl/sapl/.env && \ rm -rf /var/interlegis/sapl/sapl.db diff --git a/gunicorn_start.sh b/gunicorn_start.sh index 79666cf19..dd05a3a0e 100755 --- a/gunicorn_start.sh +++ b/gunicorn_start.sh @@ -23,7 +23,7 @@ DJANGO_WSGI_MODULE=sapl.wsgi # WSGI module name (*) echo "Starting $NAME as `whoami` on base dir $SAPL_DIR" -# parameter can be passed to run without virtualenv +# parameter can be passed to run without virtualenv if [[ "$@" != "no-venv" ]]; then # Activate the virtual environment cd $DJANGODIR @@ -42,4 +42,6 @@ exec gunicorn ${DJANGO_WSGI_MODULE}:application \ --name $NAME \ --workers $NUM_WORKERS \ --user $USER \ + --access-logfile /var/log/gunicorn/gunicorn-access.log \ + --error-logfile /var/log/gunicorn/gunicorn-error.log \ --bind=unix:$SOCKFILE