File size: 1,339 Bytes
af564a4 c786fe1 7929c76 c786fe1 e743c17 af564a4 7929c76 | 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 35 36 37 38 39 40 41 42 43 44 45 46 | FROM python:3.11-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libsndfile1 \
ffmpeg \
git \
rubberband-cli \
librubberband-dev \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user
WORKDIR /app
RUN pip install --no-cache-dir torch==2.8.0 torchaudio==2.8.0
ENV GIT_LFS_SKIP_SMUDGE=1
RUN pip install --no-cache-dir "indextts[webui] @ git+https://github.com/index-tts/index-tts.git@main"
RUN python -c "import indextts; import os; \
pkg_dir = os.path.dirname(indextts.__file__); \
cache_dir = os.path.join(pkg_dir, 'utils', 'tagger_cache'); \
os.makedirs(cache_dir, exist_ok=True)" \
&& chmod -R a+rw $(python -c "import indextts; import os; print(os.path.dirname(indextts.__file__))")/utils/tagger_cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN mkdir -p checkpoints && \
python -c "from huggingface_hub import snapshot_download; snapshot_download('IndexTeam/IndexTTS-2', local_dir='checkpoints')" \
|| echo "Model download deferred to runtime startup"
COPY . .
RUN chown -R user:user /app
USER user
ENV PYTHONUNBUFFERED=1
ENV HF_HOME=/app/.cache/huggingface
ENV MODEL_DIR=/app/checkpoints
EXPOSE 7860
CMD ["sh", "-c", "OMP_NUM_THREADS=4 exec uvicorn app:app --host 0.0.0.0 --port 7860"]
|