Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718FROM python:3.12-slim
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir \ fastapi "uvicorn[standard]" numpy soundfile \ https://github.com/KittenML/KittenTTS/releases/download/0.8.1/kittentts-0.8.1-py3-none-any.whl
# Slow, rarely-changing layer: pre-download the model so first request is fast.# Kept BEFORE the server.py COPY so editing the server does not re-download the model.RUN HF_HOME=/models/hf python -c "from kittentts import KittenTTS; KittenTTS('KittenML/kitten-tts-mini-0.8', cache_dir='/models/hf'); print('model cached')"
WORKDIR /appCOPY server.py /app/server.py
EXPOSE 8899CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8899"]