File size: 1,043 Bytes
4d103c0
 
 
 
fa1d551
4d103c0
 
 
 
 
fa1d551
 
4d103c0
fa1d551
 
 
 
 
 
 
 
 
 
 
 
4d103c0
 
fa1d551
4d103c0
 
 
fa1d551
4d103c0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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"]