Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -7
Dockerfile
CHANGED
|
@@ -2,22 +2,32 @@ FROM python:3.10-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# 1. Installation de git
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
git \
|
| 8 |
libsndfile1 \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
-
# 2.
|
| 12 |
-
|
| 13 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
-
# 3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
COPY app.py .
|
| 17 |
|
| 18 |
-
#
|
| 19 |
ENV HF_HOME=/app/cache
|
| 20 |
RUN mkdir -p /app/cache && chmod 777 /app/cache
|
| 21 |
|
| 22 |
-
#
|
| 23 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# 1. Installation de git et des outils audio (indispensable)
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
git \
|
| 8 |
libsndfile1 \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
+
# 2. Installation des dépendances Python de base
|
| 12 |
+
RUN pip install --no-cache-dir fastapi uvicorn python-multipart scipy torch huggingface_hub
|
|
|
|
| 13 |
|
| 14 |
+
# 3. CLONAGE MANUEL (Ceci corrige l'erreur "Config file not found")
|
| 15 |
+
# On télécharge tout le dossier source au lieu de laisser pip le faire en cache caché
|
| 16 |
+
RUN git clone https://github.com/kyutai-labs/pocket-tts.git /app/pocket-tts-src
|
| 17 |
+
|
| 18 |
+
# 4. Installation du paquet téléchargé
|
| 19 |
+
WORKDIR /app/pocket-tts-src
|
| 20 |
+
RUN pip install -e .
|
| 21 |
+
|
| 22 |
+
# 5. Retour à la racine pour votre application
|
| 23 |
+
WORKDIR /app
|
| 24 |
+
|
| 25 |
+
# 6. Copie de votre script API
|
| 26 |
COPY app.py .
|
| 27 |
|
| 28 |
+
# 7. Création du dossier cache (pour éviter les erreurs de permission HF)
|
| 29 |
ENV HF_HOME=/app/cache
|
| 30 |
RUN mkdir -p /app/cache && chmod 777 /app/cache
|
| 31 |
|
| 32 |
+
# 8. Lancement du serveur sur le port 7860
|
| 33 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|