diff --git a/Dockerfile b/Dockerfile index ae59305..10bf4ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,4 +3,4 @@ ADD . /app WORKDIR /app RUN pip install -r requirements.txt ENV FLASK_APP=app.py -CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:5005", "app:app"] +CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:5005", "--log-level", "debug", "app:app"] diff --git a/Makefile b/Makefile index bc473fc..333f991 100644 --- a/Makefile +++ b/Makefile @@ -3,3 +3,8 @@ css: password: python -c "import bcrypt; from getpass import getpass; print(bcrypt.hashpw(getpass().encode('utf-8'), bcrypt.gensalt()).decode('utf-8'))" + +update: + docker-compose stop + git pull + docker-compose up -d --force-recreate --build diff --git a/app.py b/app.py index e521e2a..fe0c444 100644 --- a/app.py +++ b/app.py @@ -57,6 +57,12 @@ from utils.webfinger import get_actor_url app = Flask(__name__) app.secret_key = get_secret_key('flask') +# Hook up Flask logging with gunicorn +gunicorn_logger = logging.getLogger('gunicorn.error') +root_logger = logging.getLogger() +root_logger.handlers = gunicorn_logger.handlers +root_logger.setLevel(gunicorn_logger.level) + JWT_SECRET = get_secret_key('jwt') JWT = JSONWebSignatureSerializer(JWT_SECRET)