From ca666931be5695b6869b5df934150806127473e8 Mon Sep 17 00:00:00 2001 From: ovosimpatico Date: Mon, 26 Aug 2024 14:09:23 -0300 Subject: [PATCH] Use a proper WSGI server --- Dockerfile | 4 ++-- README.md | 1 - docker-compose.yml | 1 + requirements.txt | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 95433df..f2d8b48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,5 +16,5 @@ EXPOSE 5000 # Define environment variable ENV FLASK_APP=run.py -# Run the application -CMD ["flask", "run", "--host=0.0.0.0"] \ No newline at end of file +# Run the application using Gunicorn +CMD ["gunicorn", "--bind", "0.0.0.0:5000", "run:app"] \ No newline at end of file diff --git a/README.md b/README.md index 3553816..d6abc54 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@

About • - FeaturesPrerequisitesInstallationUsage • diff --git a/docker-compose.yml b/docker-compose.yml index a228999..9995a0a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,4 +6,5 @@ services: - "5000:5000" environment: - FLASK_ENV=production + - GUNICORN_CMD_ARGS="--workers=3" restart: unless-stopped \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 5eaf725..4287cd1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ flask -requests \ No newline at end of file +requests +gunicorn \ No newline at end of file