Spaces:
Sleeping
Sleeping
| # 1. On part d'une version légère de Python | |
| FROM python:3.10-slim | |
| # 2. On installe les outils système pour l'audio (indispensable) | |
| RUN apt-get update && apt-get install -y \ | |
| libsndfile1 \ | |
| ffmpeg \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 3. On prépare le dossier de travail | |
| WORKDIR /app | |
| # 4. On installe les librairies Python (requirements.txt) | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 5. ASTUCE : On copie le script de téléchargement et on le lance MAINTENANT | |
| # Le modèle sera ainsi gravé dans l'image Docker | |
| COPY download_model.py . | |
| RUN python download_model.py | |
| # 6. On copie le reste de ton code (app.py) | |
| COPY . . | |
| # 7. On donne les droits (Hugging Face aime bien l'utilisateur 1000) | |
| RUN chmod -R 777 /app | |
| # 8. La commande de démarrage | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |