From a441b4612a285ae8f81b82cbd08160d7982f8cfb Mon Sep 17 00:00:00 2001 From: William Peebles Date: Wed, 30 Nov 2022 01:09:22 -0500 Subject: [PATCH] implement gunicorn for prod WSGI server --- Dockerfile | 2 +- app/requirements.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4c3adc7..c77976c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,4 +3,4 @@ COPY ./app /app WORKDIR /app RUN pip3 install -r requirements.txt ENV FLASK_APP=app.py -CMD ["python3", "-m", "flask", "run", "--host=0.0.0.0", "--port=80"] \ No newline at end of file +CMD ["gunicorn", "-b", "0.0.0.0:80", "-w", "4", "app:app"] \ No newline at end of file diff --git a/app/requirements.txt b/app/requirements.txt index fb83cc6..b935201 100644 --- a/app/requirements.txt +++ b/app/requirements.txt @@ -1,6 +1,9 @@ # This file is used by pip to install required python packages # Usage: pip install -r requirements.txt +# Gunicorn WSGI Server +gunicorn==20.1.0 + # Flask Framework click==8.1.3 Flask==2.2.2