chouchouvs commited on
Commit
ac071f7
·
verified ·
1 Parent(s): 60865cc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -17
Dockerfile CHANGED
@@ -1,27 +1,34 @@
1
- # Image légère
2
  FROM python:3.11-slim
3
 
4
- ENV PYTHONDONTWRITEBYTECODE=1 \
5
- PYTHONUNBUFFERED=1 \
6
- PORT=7860 \
7
- HF_HOME=/home/user/.cache/huggingface
8
-
9
- # Dépendances système si besoin d'openpyxl/pandas/ssl
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
- build-essential curl ca-certificates && \
12
- rm -rf /var/lib/apt/lists/*
13
 
14
  WORKDIR /app
15
 
16
- # D’abord requirements pour profiter du cache Docker
17
- COPY requirements.txt /app/requirements.txt
18
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
19
 
20
- # Puis ton code
21
- COPY . /app
 
22
 
23
- # Expose le port attendu par Spaces
24
  EXPOSE 7860
25
 
26
- # Démarrage FastAPI
27
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # ==== Base HF Docker Space ====
2
  FROM python:3.11-slim
3
 
4
+ # Système (librairies légères utiles à pandas/openpyxl)
 
 
 
 
 
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ git build-essential \
7
+ && rm -rf /var/lib/apt/lists/*
8
 
9
  WORKDIR /app
10
 
11
+ # Dépendances Python minimales (ajoute les tiennes si besoin)
12
+ RUN pip install --no-cache-dir \
13
+ fastapi==0.112.2 \
14
+ uvicorn[standard]==0.30.5 \
15
+ requests==2.32.3 \
16
+ pandas==2.2.2 \
17
+ openpyxl==3.1.5
18
+
19
+ # === Récupère ton code RFPmaster (public) ===
20
+ # (depth=1 pour cloner plus vite)
21
+ RUN git clone --depth 1 https://github.com/chourmovs/RFPmaster.git /app/RFPmaster
22
+
23
+ # Ajoute le repo au PYTHONPATH pour pouvoir `import rfp_parser`
24
+ ENV PYTHONPATH="/app/RFPmaster:${PYTHONPATH}"
25
 
26
+ # Copie l'app FastAPI (le fichier API de ce Space)
27
+ # -> on suppose que ton fichier s'appelle rfp_api_app.py (voir §2)
28
+ COPY rfp_api_app.py /app/rfp_api_app.py
29
 
30
+ # Expose le port standard des Spaces
31
  EXPOSE 7860
32
 
33
+ # Lance l'API
34
+ CMD ["uvicorn", "rfp_api_app:app", "--host", "0.0.0.0", "--port", "7860"]