From 58371bd3ffcb4805cd24a8f239dd941bbcac6571 Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Mon, 23 Mar 2020 10:10:28 -0700 Subject: Use a config file for gunicorn This will make it easy to maintain a consistent config without relying on invocation via pipenv. --- Pipfile | 10 +--------- config/gunicorn.conf.py | 5 +++++ 2 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 config/gunicorn.conf.py diff --git a/Pipfile b/Pipfile index 8e2f185..f7cd83b 100644 --- a/Pipfile +++ b/Pipfile @@ -55,15 +55,7 @@ testb = """ -c 'pipenv run coverage run -m unittest' """ report = "coverage report" -snekbox = """ - gunicorn \ - -w 2 \ - -b 0.0.0.0:8060 \ - --logger-class snekbox.GunicornLogger \ - --access-logformat '%(m)s %(U)s%(q)s %(s)s %(b)s %(L)ss' \ - --access-logfile - \ - snekbox.api.app -""" +snekbox = "gunicorn -c config/gunicorn.conf.py snekbox.api.app" devsh = "sh scripts/dev.sh" build = """ docker build \ diff --git a/config/gunicorn.conf.py b/config/gunicorn.conf.py new file mode 100644 index 0000000..5ab11f4 --- /dev/null +++ b/config/gunicorn.conf.py @@ -0,0 +1,5 @@ +workers = 2 +bind = "0.0.0.0:8060" +logger_class = "snekbox.GunicornLogger" +access_logformat = "%(m)s %(U)s%(q)s %(s)s %(b)s %(L)ss" +access_logfile = "-" -- cgit v1.2.3