diff --git a/project/backend/Dockerfile b/project/backend/Dockerfile index 196f4bc..17c32dd 100644 --- a/project/backend/Dockerfile +++ b/project/backend/Dockerfile @@ -1,5 +1,5 @@ # 1. Python-Image verwenden -FROM python:3.11-slim +FROM python:3.11-alpine # 2. Arbeitsverzeichnis im Container setzen WORKDIR /app @@ -12,4 +12,8 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . . # 5. Flask-App starten -CMD ["python", "app.py"] +# production-style server mit gunicorn +RUN pip install gunicorn + +CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"] + diff --git a/project/backend/app.py b/project/backend/app.py index ecb21ef..1c7dc8e 100644 --- a/project/backend/app.py +++ b/project/backend/app.py @@ -5,10 +5,9 @@ import os app = Flask(__name__) -# Startseite -@app.route("/") -def hello(): - return "Startseite" +@app.route("/health") +def health_check(): + return "OK" # gibt Beispiel-Konfig der Kennzahlen zurück (für die UI) @@ -22,8 +21,8 @@ def get_config(): # liefert Beispiel-Ergebnisse der Extraktion -@app.route("/dummy_results", methods=["GET"]) -def get_dummy_results(): +@app.route("/extraction_results", methods=["GET"]) +def get_extraction_results(): results = [ {"label": "Fondname", "entity": "ABC Fonds", "page": 1, "status": "validated"}, {