From 5c90c7378d64c526b568cb7670e2323037167531 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 21 Jun 2022 00:32:56 -0500 Subject: [PATCH] gunicorn: add config file. --- Dockerfile | 2 +- gunicorn.conf.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 gunicorn.conf.py diff --git a/Dockerfile b/Dockerfile index 9fb890e..5ff8276 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,4 +33,4 @@ EXPOSE 5000 ENTRYPOINT ["tini", "--", "poetry", "run"] #CMD ["autotag"] #CMD ["flask", "run", "--host", "0.0.0.0"] -CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:5000"] +CMD ["gunicorn"] diff --git a/gunicorn.conf.py b/gunicorn.conf.py new file mode 100644 index 0000000..0627c28 --- /dev/null +++ b/gunicorn.conf.py @@ -0,0 +1,11 @@ +from os import getenv +from distutils.util import strtobool + +wsgi_app = "app:app" +bind = getenv("GUNICORN_BIND", "0.0.0.0:5000") +workers = int(getenv("GUNICORN_WORKERS", 1)) +threads = int(getenv("GUNICORN_THREADS", 4)) +accesslog = getenv("GUNICORN_ACCESSLOG", "-") +errorlog = getenv("GUNICORN_ERRORLOG", "-") +loglevel = getenv("GUNICORN_LOGLEVEL", "info") +preload_app = bool(strtobool(getenv("GUNICORN_PRELOAD", "True")))