From 1950d759baefe243d391cd63cd07b4973c46d362 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Thu, 13 Apr 2023 14:58:39 +0200 Subject: [PATCH] add gunicorn 2 --- Dockerfile | 4 +++- gunicorn_config.py | 3 +++ wsgi.py | 4 ---- 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 gunicorn_config.py delete mode 100644 wsgi.py diff --git a/Dockerfile b/Dockerfile index e29bb9d..bb48283 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,4 +19,6 @@ RUN pip install --no-cache-dir -r requirements.txt EXPOSE 5000 -CMD [ "python3", "-m" , "flask", "run", "--port", "5000", "--host", "0.0.0.0"] + +#CMD [ "python3", "-m" , "flask", "run", "--port", "5000", "--host", "0.0.0.0"] +CMD [ "python3", "-m" , "gunicorn", "app:app", "-c", "gunicorn_config.py"] diff --git a/gunicorn_config.py b/gunicorn_config.py new file mode 100644 index 0000000..c7342ad --- /dev/null +++ b/gunicorn_config.py @@ -0,0 +1,3 @@ +bind = "0.0.0.0:5000" +workers = 2 +threads = 4 diff --git a/wsgi.py b/wsgi.py deleted file mode 100644 index 08f9dd1..0000000 --- a/wsgi.py +++ /dev/null @@ -1,4 +0,0 @@ -from app import app - -if __name__ == '__main__': - app.run()