MISSAOUI commited on
Commit
f0288ef
Β·
verified Β·
1 Parent(s): 85ec900

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -19
Dockerfile CHANGED
@@ -1,31 +1,22 @@
1
  FROM python:3.10-slim
2
 
3
- # ── Variables d'environnement ─────────────────────────────
4
- ENV PYTHONDONTWRITEBYTECODE=1
5
- ENV PYTHONUNBUFFERED=1
6
 
7
- # ── DΓ©pendances systΓ¨me (FAISS + torch + build) ───────────
8
  RUN apt-get update && apt-get install -y \
9
  build-essential \
10
  git \
11
- curl \
12
- libgomp1 \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # ── Dossier de travail ─────────────────────────────────────
16
- WORKDIR /app
17
-
18
- # ── Copier les fichiers du projet ──────────────────────────
19
- COPY . /app
20
-
21
- # ── Installer pip + dΓ©pendances Python ─────────────────────
22
- RUN pip install --upgrade pip
23
-
24
- # Si tu as requirements.txt
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
27
- # ── Port utilisΓ© par Hugging Face Spaces ───────────────────
 
 
 
28
  EXPOSE 7860
29
 
30
- # ── Lancer l’API FastAPI ───────────────────────────────────
31
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
3
+ WORKDIR /app
 
 
4
 
5
+ # System deps (important for FAISS + HF embeddings)
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  git \
 
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Install Python deps
12
+ COPY requirements.txt .
 
 
 
 
 
 
 
 
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Copy app
16
+ COPY . .
17
+
18
+ # HF Spaces uses port 7860
19
  EXPOSE 7860
20
 
21
+ # Start FastAPI with uvicorn
22
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]