Spaces:
Sleeping
Sleeping
| # ---- base image ------------------------------------------------------------ | |
| FROM python:3.11-slim | |
| # system packages for pydub/ffmpeg and torchaudio | |
| RUN apt-get update && \ | |
| apt-get install -y git ffmpeg libsndfile1 && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # set workdir | |
| WORKDIR /workspace | |
| # copy requirements & install | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # copy app code | |
| COPY app.py . | |
| COPY templates ./templates | |
| COPY static ./static | |
| # expose default Space port | |
| ENV PORT 7860 | |
| EXPOSE 7860 | |
| # gunicorn keeps the worker alive for 35 min to cover synthesis | |
| CMD ["gunicorn", "--timeout", "2100", "--workers", "1", "--bind", "0.0.0.0:7860", "app:app"] | |