Spaces:
Running
Running
File size: 836 Bytes
4f9d434 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# Verwende ein offizielles Python-Image als Basis
FROM python:3.10-slim-bullseye
# Setze das Arbeitsverzeichnis im Container
WORKDIR /app
# Kopiere die requirements.txt in das Arbeitsverzeichnis
COPY requirements.txt .
# Installiere die Python-Abhängigkeiten
# --no-cache-dir: keine Pip-Cache-Dateien schreiben
# --upgrade: installierte Pakete aktualisieren
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Kopiere den Rest deiner Anwendungsdateien (app.py, etc.) in das Arbeitsverzeichnis
COPY . .
# Exponiere den Port, auf dem Uvicorn lauschen wird
# Dies ist der Standard-Port für Hugging Face Spaces
EXPOSE 7860
# Starte die FastAPI-Anwendung mit Uvicorn
# 'app:app' bedeutet: Finde die Variable 'app' im Modul 'app.py'
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|