Review-Kommentare eingearbeitet

pull/38/head
Abdulrahman Dabbagh 2025-05-25 16:48:07 +02:00
parent cd6c66a1fd
commit af3eed2bdc
2 changed files with 11 additions and 8 deletions

View File

@ -1,5 +1,5 @@
# 1. Python-Image verwenden # 1. Python-Image verwenden
FROM python:3.11-slim FROM python:3.11-alpine
# 2. Arbeitsverzeichnis im Container setzen # 2. Arbeitsverzeichnis im Container setzen
WORKDIR /app WORKDIR /app
@ -12,4 +12,8 @@ RUN pip install --no-cache-dir -r requirements.txt
COPY . . COPY . .
# 5. Flask-App starten # 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"]

View File

@ -5,10 +5,9 @@ import os
app = Flask(__name__) app = Flask(__name__)
# Startseite @app.route("/health")
@app.route("/") def health_check():
def hello(): return "OK"
return "Startseite"
# gibt Beispiel-Konfig der Kennzahlen zurück (für die UI) # gibt Beispiel-Konfig der Kennzahlen zurück (für die UI)
@ -22,8 +21,8 @@ def get_config():
# liefert Beispiel-Ergebnisse der Extraktion # liefert Beispiel-Ergebnisse der Extraktion
@app.route("/dummy_results", methods=["GET"]) @app.route("/extraction_results", methods=["GET"])
def get_dummy_results(): def get_extraction_results():
results = [ results = [
{"label": "Fondname", "entity": "ABC Fonds", "page": 1, "status": "validated"}, {"label": "Fondname", "entity": "ABC Fonds", "page": 1, "status": "validated"},
{ {