Spaces:
Sleeping
Sleeping
| FROM python:3.10-slim | |
| WORKDIR /app | |
| # 1. Installation de git et des outils audio (indispensable) | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| libsndfile1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 2. Installation des dépendances Python de base | |
| RUN pip install --no-cache-dir fastapi uvicorn python-multipart scipy torch huggingface_hub | |
| # 3. CLONAGE MANUEL (Ceci corrige l'erreur "Config file not found") | |
| # On télécharge tout le dossier source au lieu de laisser pip le faire en cache caché | |
| RUN git clone https://github.com/kyutai-labs/pocket-tts.git /app/pocket-tts-src | |
| # 4. Installation du paquet téléchargé | |
| WORKDIR /app/pocket-tts-src | |
| RUN pip install -e . | |
| # 5. Retour à la racine pour votre application | |
| WORKDIR /app | |
| # 6. Copie de votre script API | |
| COPY app.py . | |
| # 7. Création du dossier cache (pour éviter les erreurs de permission HF) | |
| ENV HF_HOME=/app/cache | |
| RUN mkdir -p /app/cache && chmod 777 /app/cache | |
| # 8. Lancement du serveur sur le port 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |