binaryMao commited on
Commit
1c0c53c
·
verified ·
1 Parent(s): 6a90cd2

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -8
Dockerfile CHANGED
@@ -1,9 +1,9 @@
1
  FROM python:3.10-slim
2
 
3
- # Éviter les questions interactives lors de l'install
4
  ENV DEBIAN_FRONTEND=noninteractive
5
 
6
- # Installation des dépendances système
7
  RUN apt-get update && apt-get install -y \
8
  git \
9
  git-lfs \
@@ -11,26 +11,30 @@ RUN apt-get update && apt-get install -y \
11
  libsndfile1 \
12
  cmake \
13
  g++ \
 
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # Création d'un utilisateur non-root pour Hugging Face
17
  RUN useradd -m -u 1000 user
18
  USER user
19
  ENV HOME=/home/user \
20
- PATH=/home/user/.local/bin:$PATH
 
 
21
 
22
  WORKDIR $HOME/app
23
 
24
- # Installation des dépendances Python
25
- # On installe Cython en premier car NeMo en a souvent besoin pour la compilation
26
  RUN pip install --no-cache-dir --upgrade pip && \
27
  pip install --no-cache-dir Cython
28
 
 
29
  COPY --chown=user requirements.txt .
30
  RUN pip install --no-cache-dir -r requirements.txt
31
 
32
- # Copier le reste de l'application
33
  COPY --chown=user . .
34
 
35
- # Exposer le port par défaut de Hugging Face
 
36
  CMD ["python", "app.py"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Empêcher les messages interactifs
4
  ENV DEBIAN_FRONTEND=noninteractive
5
 
6
+ # Installation des dépendances système nécessaires pour NeMo et l'audio
7
  RUN apt-get update && apt-get install -y \
8
  git \
9
  git-lfs \
 
11
  libsndfile1 \
12
  cmake \
13
  g++ \
14
+ curl \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
+ # Création de l'utilisateur standard (UID 1000 obligatoire sur HF)
18
  RUN useradd -m -u 1000 user
19
  USER user
20
  ENV HOME=/home/user \
21
+ PATH=/home/user/.local/bin:$PATH \
22
+ PYTHONPATH=$HOME/app \
23
+ PYTHONUNBUFFERED=1
24
 
25
  WORKDIR $HOME/app
26
 
27
+ # Installation de pip et Cython (requis pour certains composants NeMo)
 
28
  RUN pip install --no-cache-dir --upgrade pip && \
29
  pip install --no-cache-dir Cython
30
 
31
+ # Installation des dépendances Python
32
  COPY --chown=user requirements.txt .
33
  RUN pip install --no-cache-dir -r requirements.txt
34
 
35
+ # Copie du code source
36
  COPY --chown=user . .
37
 
38
+ # Exposition du port et lancement
39
+ EXPOSE 7860
40
  CMD ["python", "app.py"]