BryanBradfo commited on
Commit
eea51d0
·
verified ·
1 Parent(s): 7cb5c2c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -16
Dockerfile CHANGED
@@ -1,33 +1,38 @@
1
- # On part d'une version légère et récente de Python
2
  FROM python:3.10-slim
3
 
4
- # On évite les questions lors des installations
5
- ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Création d'un utilisateur sécurisé (obligatoire pour HF)
8
- RUN useradd -m -u 1000 user
9
- WORKDIR /app
10
-
11
- # Installation des outils système (git, etc.)
12
  RUN apt-get update && \
13
  apt-get install -y --no-install-recommends \
14
  git \
 
15
  make \
16
- ffmpeg && \
17
  rm -rf /var/lib/apt/lists/*
18
- # Note: j'ai ajouté ffmpeg au cas où ElevenLabs en ait besoin pour l'audio
19
 
20
- # Installation des dépendances Python
 
 
 
 
 
 
 
 
21
  COPY --chown=user ./requirements.txt requirements.txt
22
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
23
 
24
- # Copie de tout ton code dans le conteneur
 
 
 
 
 
 
25
  COPY --chown=user . /app
26
- WORKDIR /app
27
 
28
- # Configuration du port et lancement
29
  EXPOSE 7860
30
  ENV GRADIO_SERVER_NAME="0.0.0.0"
31
 
32
- # Commande de lancement
33
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.10-slim
2
 
3
+ # 1. Installation des outils système (Git, Make, Stockfish)
 
 
 
 
 
 
 
4
  RUN apt-get update && \
5
  apt-get install -y --no-install-recommends \
6
  git \
7
+ stockfish \
8
  make \
9
+ wget && \
10
  rm -rf /var/lib/apt/lists/*
 
11
 
12
+ # 2. Création de l'utilisateur (Requis par HuggingFace)
13
+ RUN useradd -m -u 1000 user
14
+ USER user
15
+ ENV HOME=/home/user \
16
+ PATH=/home/user/.local/bin:$PATH
17
+
18
+ WORKDIR /app
19
+
20
+ # 3. Installation des dépendances Python
21
  COPY --chown=user ./requirements.txt requirements.txt
22
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
23
 
24
+ # 4. Téléchargement et construction de la base de données d'ouvertures (CRUCIAL)
25
+ # On clone le repo utilisé dans ton exemple
26
+ RUN git clone https://github.com/lichess-org/chess-openings.git /app/data/lichess_openings && \
27
+ cd /app/data/lichess_openings && \
28
+ make
29
+
30
+ # 5. Copie du code de l'application
31
  COPY --chown=user . /app
 
32
 
33
+ # 6. Configuration du lancement
34
  EXPOSE 7860
35
  ENV GRADIO_SERVER_NAME="0.0.0.0"
36
 
37
+ # Lancement
38
  CMD ["python", "app.py"]