| FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git \ | |
| graphviz \ | |
| libsndfile1 \ | |
| espeak-ng \ | |
| wget \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Copy project files | |
| COPY pyproject.toml . | |
| COPY requirements.txt . | |
| # Install dependencies with UV (much faster than pip) | |
| RUN uv pip install --system --index-strategy unsafe-best-match -r requirements.txt | |
| # Create onnx directories and download models | |
| RUN mkdir -p onnx/piper-voices && \ | |
| wget -q -O onnx/phonikud-1.0.int8.onnx \ | |
| https://huggingface.co/thewh1teagle/phonikud-onnx/resolve/main/phonikud-1.0.int8.onnx && \ | |
| wget -q -O onnx/piper-voices/he_IL-phonikud.onnx \ | |
| https://huggingface.co/thewh1teagle/phonikud-tts-checkpoints/resolve/main/model.onnx && \ | |
| wget -q -O onnx/piper-voices/he_IL-phonikud.onnx.json \ | |
| https://huggingface.co/thewh1teagle/phonikud-tts-checkpoints/resolve/main/model.config.json && \ | |
| wget -q -O onnx/piper-voices/en_US-ryan-high.onnx \ | |
| https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/ryan/high/en_US-ryan-high.onnx && \ | |
| wget -q -O onnx/piper-voices/en_US-ryan-high.onnx.json \ | |
| https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/ryan/high/en_US-ryan-high.onnx.json | |
| # Copy application | |
| COPY app.py ./ | |
| COPY static/ static/ | |
| COPY .streamlit/ .streamlit/ | |
| EXPOSE 7860 | |
| ENV STREAMLIT_SERVER_PORT=7860 | |
| ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0 | |
| ENV STREAMLIT_SERVER_HEADLESS=true | |
| CMD ["streamlit", "run", "app.py"] |