h-rand commited on
Commit
899fcd4
·
verified ·
1 Parent(s): f0e0a1d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +40 -0
Dockerfile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # 1. Installation des dépendances système (Mecab est obligatoire pour Melo)
6
+ RUN apt-get update && apt-get install -y \
7
+ libsndfile1 \
8
+ build-essential \
9
+ g++ \
10
+ git \
11
+ mecab \
12
+ libmecab-dev \
13
+ mecab-ipadic-utf8 \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # 2. Mise à jour de pip
17
+ RUN pip install --no-cache-dir --upgrade pip setuptools wheel
18
+
19
+ # 3. Pré-requis Numpy < 2.0 (Standard de stabilité actuel)
20
+ RUN pip install --no-cache-dir "numpy<2.0.0" Cython
21
+
22
+ # 4. Installation des dépendances de base
23
+ COPY requirements.txt .
24
+ RUN pip install --no-cache-dir -r requirements.txt
25
+
26
+ # 5. INSTALLATION MELO (Via Git pour avoir le module 'api')
27
+ RUN pip install --no-cache-dir git+https://github.com/myshell-ai/MeloTTS.git
28
+
29
+ # 6. Téléchargement du dictionnaire obligatoire
30
+ RUN python -m unidic download
31
+
32
+ # 7. Copie du code
33
+ COPY app.py .
34
+
35
+ # 8. Permissions Cache
36
+ ENV HF_HOME=/app/cache
37
+ RUN mkdir -p /app/cache && chmod 777 /app/cache
38
+
39
+ # 9. Lancement
40
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]