From 75eaf8554971f0e4ffdfa50b9574ea1579feae8c Mon Sep 17 00:00:00 2001 From: "aiyion.prime" Date: Wed, 8 Jan 2025 19:29:18 +0100 Subject: [PATCH] ci: Provide production deployment via gunicorn --- Dockerfile | 4 ++-- docker-compose.yaml | 3 --- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 33b5e70..05136b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,5 +15,5 @@ RUN pip install --no-cache-dir -r requirements.txt # Quellcode in den Container kopieren COPY . . -# Flask Server starten -CMD ["flask", "run", "--host=0.0.0.0", "--port=8003"] +# Gunicorn Server starten +CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8003", "app:app"] diff --git a/docker-compose.yaml b/docker-compose.yaml index c45835a..032c0c8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,8 +5,5 @@ services: - "8003:8003" volumes: - ./app/config.py:/app/app/config.py:ro # Die lokale config.py in den Container mounten - environment: - FLASK_ENV: development - FLASK_APP: app # Setzt das Flask App-Modul restart: always diff --git a/requirements.txt b/requirements.txt index 19a81c7..c9566b6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ flask -gunicorn +gunicorn==23.0.0 Flask-WTF lxml email_validator