FROM python:3.11-slim # System deps for llama-cpp-python build + audio RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cmake \ libopenblas-dev \ libsndfile1 \ ffmpeg \ git \ curl \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy requirements first for layer caching COPY requirements.txt . # Install Python deps # llama-cpp-python: CPU-only build (set CMAKE_ARGS for GPU at build time) ENV CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" RUN pip install --no-cache-dir -r requirements.txt # Copy app COPY app.py . # Model cache dir (populated at first run from HF Hub) RUN mkdir -p /app/model # Kokoro voices cache ENV HF_HOME=/app/hf_cache RUN mkdir -p /app/hf_cache EXPOSE 7860 CMD ["python", "app.py"]