Skip to content

Commit

Permalink
add gunicorn_config
Browse files Browse the repository at this point in the history
  • Loading branch information
petrjasek committed Dec 15, 2023
1 parent 36aba9b commit 8eadf5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/Procfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
web: gunicorn -b 0.0.0.0:$PORT -w 3 newsroom.web.app:app
web: gunicorn -c gunicorn_config.py newsroom.web.app:app
websocket: python -m newsroom.web.ws
worker: celery -A newsroom.web.worker.celery worker
beat: celery -A newsroom.web.worker.celery beat
Expand Down
10 changes: 10 additions & 0 deletions server/gunicorn_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import os

bind = "0.0.0.0:%s" % os.environ.get("PORT", "5000")
workers = int(os.environ.get("WEB_CONCURRENCY", 3))
timeout = int(os.environ.get("WEB_TIMEOUT", 30))

accesslog = "-"
access_log_format = "%(m)s %(U)s status=%(s)s time=%(T)ss size=%(B)sb"

reload = "NEWSROOM_RELOAD" in os.environ

0 comments on commit 8eadf5e

Please sign in to comment.