Zeldeo commited on
Commit
5083527
·
verified ·
1 Parent(s): be5be8e

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Installe les dépendances système
6
+ RUN apt-get update && apt-get install -y \
7
+ libgl1-mesa-glx \
8
+ libglib2.0-0 \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ COPY requirements.txt .
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ COPY app.py .
15
+
16
+ # HuggingFace Spaces expose le port 7860
17
+ EXPOSE 7860
18
+
19
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
20
+ ```
21
+
22
+ > ⚠️ HF Spaces impose le port **7860** avec Docker.
23
+
24
+ ---
25
+
26
+ ## Étape 3 — Ton URL d'API
27
+
28
+ Une fois déployé (5-10 min), ton endpoint sera :
29
+ ```
30
+ https://TON_USERNAME-NOM_DU_SPACE.hf.space/detect