diff --git a/Dockerfile b/Dockerfile index 92053ae..4faf2a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,4 +23,4 @@ RUN ./scripts/setup-python.sh RUN rm -rf ./static EXPOSE 8000 -CMD ["gunicorn", "-b", "0.0.0.0:8000", "--preload", "--access-logfile", "/dev/stdout", "website.wsgi:application"] +CMD ["gunicorn", "-c", "website/gunicorn.conf.py", "--access-logfile", "/dev/stdout", "website.wsgi:application"] diff --git a/scripts/test.sh b/scripts/test.sh index 0d8f351..e86178c 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -19,3 +19,5 @@ isort -rc -c website/ mypy website/ eslint static/src/js + +gunicorn --check-config -c website/gunicorn.conf.py website.wsgi:application diff --git a/website/gunicorn.conf.py b/website/gunicorn.conf.py new file mode 100644 index 0000000..59e593b --- /dev/null +++ b/website/gunicorn.conf.py @@ -0,0 +1,6 @@ +import multiprocessing + +bind = "0.0.0.0:8000" +workers = multiprocessing.cpu_count() * 2 + 1 +threads = 2 +preload = True