VRDate's picture
Update Dockerfile
27b2c42 verified
Raw
History Blame Contribute Delete
1.83 kB
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/
# Port: 7860 = Streamlit UI
EXPOSE 7860
# Streamlit config
ENV STREAMLIT_SERVER_PORT=7860
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
ENV STREAMLIT_SERVER_HEADLESS=true
# NLP Pipeline config (defaults - override at runtime)
# ENV TORCH_THREADS=8
# ENV WORKERS=24
# ENV METRICS_LOG_INTERVAL=60
# ENV METRICS_PORT=7861 # Uncomment to enable HTTP metrics server
CMD ["streamlit", "run", "app.py"]