From d125d75cf6ffc6ab61a0dbef26e7dd6446265b4f Mon Sep 17 00:00:00 2001 From: a-baur Date: Mon, 18 Mar 2024 15:22:42 +0100 Subject: [PATCH] added WSGI production server when running via docker --- Dockerfile | 2 +- src/requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4d2465a..30c6bdd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,4 +16,4 @@ ENV FLASK_APP=main.py EXPOSE 5000 -CMD ["python3", "-m", "flask", "run", "--host=0.0.0.0"] +CMD ["python3", "-m", "gunicorn", "main:app", "--bind=0.0.0.0:5000", "--workers=4"] diff --git a/src/requirements.txt b/src/requirements.txt index 674c6a7..fcaddcd 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -5,6 +5,7 @@ dateparser==1.1.1 Flask==2.0.3 Flask-BasicAuth==0.2.0 Flask-Cors==3.0.10 +gunicorn==21.2.0 influxdb==5.3.1 Jinja2==3.0.3 jsonschema==3.2.0