aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-03-23 10:10:28 -0700
committerGravatar MarkKoz <[email protected]>2020-03-23 10:33:00 -0700
commit58371bd3ffcb4805cd24a8f239dd941bbcac6571 (patch)
tree99c09ba6c7ecbfd99d95d982614cdb195b1cc212
parentMove snekbox.cfg to a config directory (diff)
Use a config file for gunicorn
This will make it easy to maintain a consistent config without relying on invocation via pipenv.
-rw-r--r--Pipfile10
-rw-r--r--config/gunicorn.conf.py5
2 files changed, 6 insertions, 9 deletions
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 = "-"