Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| # System dependencies | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| ffmpeg \ | |
| git \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install numpy FIRST (pkuseg needs it at build time in setup.py) | |
| RUN pip install --no-cache-dir "numpy>=1.24,<2" | |
| # Install chatterbox-tts with --no-build-isolation so pkuseg sees numpy | |
| RUN pip install --no-cache-dir --no-build-isolation chatterbox-tts | |
| # Install remaining dependencies | |
| RUN pip install --no-cache-dir \ | |
| torch \ | |
| torchaudio \ | |
| soundfile \ | |
| pydub \ | |
| fastapi \ | |
| uvicorn \ | |
| gradio==5.31.0 | |
| # Create non-root user (required by HF Spaces) | |
| RUN useradd -m -u 1000 user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR /home/user/app | |
| # Copy application | |
| COPY --chown=user app.py . | |
| USER user | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] | |