chouchouvs commited on
Commit
4aba207
·
verified ·
1 Parent(s): 04abc0d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -8
Dockerfile CHANGED
@@ -1,26 +1,30 @@
1
  FROM python:3.11-slim
2
 
3
- # Outils minimes (curl pour healthcheck)
4
- RUN apt-get update && apt-get install -y --no-install-recommends curl \
 
5
  && rm -rf /var/lib/apt/lists/*
6
 
7
  WORKDIR /app
8
 
9
- # Deps
 
 
 
 
 
 
10
  COPY requirements.txt .
11
- RUN python -m pip install --upgrade pip && pip install -r requirements.txt
 
12
 
13
  # Code
14
  COPY main.py .
15
 
16
- # HF Spaces fournit PORT (ex: 7860). On met une valeur par défaut au cas où.
17
- ENV PORT=7860
18
-
19
  EXPOSE 7860
20
 
21
  # Healthcheck sur /health
22
  HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
23
  CMD curl -fsS "http://localhost:${PORT}/health" || exit 1
24
 
25
- # 🔑 IMPORTANT : on lance via Python, qui lit $PORT et démarre Uvicorn dessus
26
  CMD ["python", "-u", "/app/main.py"]
 
1
  FROM python:3.11-slim
2
 
3
+ # OS deps : curl (healthcheck) + libgomp1 (FAISS)
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ curl libgomp1 \
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
  WORKDIR /app
9
 
10
+ # Env utiles
11
+ ENV PORT=7860 \
12
+ UI_PATH=/ui \
13
+ HF_HUB_DISABLE_TELEMETRY=1 \
14
+ MPLCONFIGDIR=/tmp/mpl
15
+
16
+ # Dépendances Python
17
  COPY requirements.txt .
18
+ RUN python -m pip install --upgrade pip \
19
+ && pip install --no-cache-dir -r requirements.txt
20
 
21
  # Code
22
  COPY main.py .
23
 
 
 
 
24
  EXPOSE 7860
25
 
26
  # Healthcheck sur /health
27
  HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
28
  CMD curl -fsS "http://localhost:${PORT}/health" || exit 1
29
 
 
30
  CMD ["python", "-u", "/app/main.py"]