FROM python:3.11-slim # CRITICAL: espeak-ng required for KittenTTS phonemization RUN apt-get update && apt-get install -y --no-install-recommends \ espeak-ng \ libsndfile1 \ ffmpeg \ git \ && rm -rf /var/lib/apt/lists/* # HF Spaces requires uid 1000 RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" ENV HF_HOME="/home/user/.cache/huggingface" WORKDIR /home/user/app COPY --chown=user:user requirements.txt . RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt COPY --chown=user:user . . EXPOSE 7860 CMD ["python", "app.py"]