meloFR / Dockerfile
h-rand's picture
Create Dockerfile
899fcd4 verified
FROM python:3.10-slim
WORKDIR /app
# 1. Installation des dépendances système (Mecab est obligatoire pour Melo)
RUN apt-get update && apt-get install -y \
libsndfile1 \
build-essential \
g++ \
git \
mecab \
libmecab-dev \
mecab-ipadic-utf8 \
&& rm -rf /var/lib/apt/lists/*
# 2. Mise à jour de pip
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
# 3. Pré-requis Numpy < 2.0 (Standard de stabilité actuel)
RUN pip install --no-cache-dir "numpy<2.0.0" Cython
# 4. Installation des dépendances de base
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 5. INSTALLATION MELO (Via Git pour avoir le module 'api')
RUN pip install --no-cache-dir git+https://github.com/myshell-ai/MeloTTS.git
# 6. Téléchargement du dictionnaire obligatoire
RUN python -m unidic download
# 7. Copie du code
COPY app.py .
# 8. Permissions Cache
ENV HF_HOME=/app/cache
RUN mkdir -p /app/cache && chmod 777 /app/cache
# 9. Lancement
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]