Frajosgro commited on
Commit
da51b43
·
verified ·
1 Parent(s): b193d1b

Update dockerfile

Browse files
Files changed (1) hide show
  1. dockerfile +13 -7
dockerfile CHANGED
@@ -1,14 +1,20 @@
 
1
  FROM python:3.9-slim
2
 
 
3
  WORKDIR /app
4
- COPY . .
5
 
6
- RUN pip install --no-cache-dir \
7
- fastapi \
8
- uvicorn \
9
- langchain \
10
- huggingface-hub \
11
- langchain-community
12
 
 
 
 
 
13
  EXPOSE 7860
 
 
14
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Basis-Image mit Python 3.9 (slim für reduzierte Größe)
2
  FROM python:3.9-slim
3
 
4
+ # Arbeitsverzeichnis erstellen
5
  WORKDIR /app
 
6
 
7
+ # Zuerst nur requirements.txt kopieren (für Caching-Optimierung)
8
+ COPY requirements.txt .
9
+
10
+ # Abhängigkeiten installieren
11
+ RUN pip install --no-cache-dir -r requirements.txt
 
12
 
13
+ # Restliche Dateien kopieren
14
+ COPY . .
15
+
16
+ # Port freigeben (für Hugging Face Spaces obligatorisch)
17
  EXPOSE 7860
18
+
19
+ # FastAPI starten (mit 0.0.0.0 für externe Zugriffe)
20
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]