# Lightweight CPU-only base FROM python:3.10-slim # Install system tools: git (for cloning F5-TTS), ffmpeg (audio processing), libsndfile RUN apt-get update && apt-get install -y \ git \ ffmpeg \ libsndfile1 \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Install torch CPU + FastAPI + Uvicorn + other minimal deps RUN pip install --no-cache-dir --upgrade pip \ && pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu \ && pip install fastapi uvicorn[standard] soundfile python-multipart \ && pip install git+https://github.com/SWivid/F5-TTS.git # Copy the API code COPY app.py /app/app.py # Expose FastAPI port (you can change if needed) EXPOSE 7860 # Run with Uvicorn (production-ready server) CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]