Browse Source

Adiciona logs a gunicorn (#1526)

pull/1537/head
Edward 7 years ago
committed by GitHub
parent
commit
ca7a7c6147
  1. 3
      Dockerfile
  2. 4
      gunicorn_start.sh

3
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

4
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

Loading…
Cancel
Save