FROM python:3.11-slim RUN apt-get update && apt-get install -y --no-install-recommends \ git \ ffmpeg \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY lightweight_infer.py . COPY app.py . # Download model at build time to cache in docker layer RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='msingiai/sauti-tts', filename='vocab.txt'); hf_hub_download(repo_id='msingiai/sauti-tts', filename='model_last.pt')" EXPOSE 7860 # Use uvicorn for FastAPI CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]