mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 03:04:28 +00:00
Improve logging
This commit is contained in:
parent
694511121c
commit
cc900a2b4c
3 changed files with 12 additions and 1 deletions
|
@ -3,4 +3,4 @@ ADD . /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
ENV FLASK_APP=app.py
|
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"]
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -3,3 +3,8 @@ css:
|
||||||
|
|
||||||
password:
|
password:
|
||||||
python -c "import bcrypt; from getpass import getpass; print(bcrypt.hashpw(getpass().encode('utf-8'), bcrypt.gensalt()).decode('utf-8'))"
|
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
|
||||||
|
|
6
app.py
6
app.py
|
@ -57,6 +57,12 @@ from utils.webfinger import get_actor_url
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.secret_key = get_secret_key('flask')
|
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_SECRET = get_secret_key('jwt')
|
||||||
JWT = JSONWebSignatureSerializer(JWT_SECRET)
|
JWT = JSONWebSignatureSerializer(JWT_SECRET)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue