FROM python:3.11-slim WORKDIR /app # Install system dependencies for onnxruntime and espeak-ng RUN apt-get update && apt-get install -y --no-install-recommends \ espeak-ng libespeak-ng1 \ libgomp1 \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies RUN pip install --no-cache-dir \ onnxruntime==1.20.0 \ numpy==1.26.4 \ soundfile==0.12.1 \ fastapi==0.115.0 \ uvicorn[standard]==0.32.0 \ pydantic==2.9.0 \ requests==2.32.0 \ espeakng-loader==0.2.4 \ phonemizer-fork==3.3.2 # Install kokoro-onnx without deps RUN pip install --no-cache-dir --no-deps kokoro-onnx==0.5.0 COPY main.py . ENV PORT=7860 EXPOSE 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]