Spaces:
Runtime error
Runtime error
File size: 660 Bytes
df862a6 e8275ee f78cb7f e8275ee d5a35cb f78cb7f 9586902 3914a99 7b63696 3914a99 7b63696 9586902 3914a99 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
FROM ghcr.io/remsky/kokoro-fastapi-cpu:latest
# Environment setup
ENV HOST=0.0.0.0
ENV PORT=7860
# ONNX optimization for 2 CPU environment
ENV ONNX_MAX_INSTANCES=2
ENV ONNX_NUM_THREADS=2
ENV ONNX_INTER_OP_THREADS=1
ENV VOICE_CACHE_SIZE=1
# Add root redirect to main.py
USER root
RUN sed -i '/# Health check endpoint/i \
# Root redirect to web player\
@app.get("/")\
async def root_redirect():\
from fastapi.responses import RedirectResponse\
return RedirectResponse(url="/web/")\
\
' /app/api/src/main.py
USER appuser
EXPOSE 7860
# Run FastAPI
CMD ["uv", "run", "python", "-m", "uvicorn", "api.src.main:app", "--host", "0.0.0.0", "--port", "7860"] |