Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +20 -24
Dockerfile
CHANGED
|
@@ -1,24 +1,20 @@
|
|
| 1 |
-
# Verwende ein offizielles Python-Image als Basis
|
| 2 |
-
FROM python:3.10-slim-bullseye
|
| 3 |
-
|
| 4 |
-
# Setze das Arbeitsverzeichnis im Container
|
| 5 |
-
WORKDIR /app
|
| 6 |
-
|
| 7 |
-
# Kopiere die requirements.txt in das Arbeitsverzeichnis
|
| 8 |
-
COPY requirements.txt .
|
| 9 |
-
|
| 10 |
-
# Installiere die Python-Abhängigkeiten
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
#
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
# Starte die FastAPI-Anwendung mit Uvicorn
|
| 23 |
-
# 'app:app' bedeutet: Finde die Variable 'app' im Modul 'app.py'
|
| 24 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Verwende ein offizielles Python-Image als Basis
|
| 2 |
+
FROM python:3.10-slim-bullseye
|
| 3 |
+
|
| 4 |
+
# Setze das Arbeitsverzeichnis im Container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Kopiere die requirements.txt in das Arbeitsverzeichnis
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
|
| 10 |
+
# Installiere die Python-Abhängigkeiten
|
| 11 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 12 |
+
|
| 13 |
+
# Kopiere den Rest deiner Anwendungsdateien (app.py, etc.) in das Arbeitsverzeichnis
|
| 14 |
+
COPY . .
|
| 15 |
+
|
| 16 |
+
# Exponiere den Port, auf dem Uvicorn lauschen wird
|
| 17 |
+
EXPOSE 7860
|
| 18 |
+
|
| 19 |
+
# Starte die FastAPI-Anwendung mit Uvicorn
|
| 20 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
|
|
|