Spaces:
Running
Running
File size: 1,770 Bytes
596438d cfbf403 cd47134 cfbf403 596438d 6109e6d 596438d cd47134 596438d cfbf403 596438d cd47134 cfbf403 cd47134 596438d cd47134 596438d cfbf403 cd47134 596438d cd47134 | 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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | FROM python:3.11-slim
WORKDIR /app
# Install system deps
RUN apt-get update && apt-get install -y \
wget curl tar python3-venv \
&& rm -rf /var/lib/apt/lists/*
# Copy frontend static files
COPY index.html app.js services.css about.html contact.html ./
# Copy backend
COPY deepshell-backend/ ./deepshell-backend/
# Install DeepShell Python deps
RUN pip install --no-cache-dir -r deepshell-backend/requirements.txt && \
pip install --no-cache-dir httpx && \
pip install --no-cache-dir -e deepshell-backend/
# Install LibreTranslate in separate venv
RUN python3 -m venv /opt/venvs/libretranslate && \
/opt/venvs/libretranslate/bin/pip install --no-cache-dir libretranslate==1.9.5
# Pre-download LibreTranslate language models
RUN /opt/venvs/libretranslate/bin/libretranslate --load-only en,hi --update-files || true
# Download Piper binary
RUN wget -q https://github.com/rhasspy/piper/releases/download/2023.11.14-2/piper_linux_x86_64.tar.gz \
&& tar -xzf piper_linux_x86_64.tar.gz \
&& rm piper_linux_x86_64.tar.gz \
&& mv piper /opt/piper
# Download Hindi voice model
RUN mkdir -p /opt/piper/voices && \
wget -q https://huggingface.co/rhasspy/piper-voices/resolve/main/hi/hi_IN/rohan/medium/hi_IN-rohan-medium.onnx \
-O /opt/piper/voices/hi_IN-rohan-medium.onnx && \
wget -q https://huggingface.co/rhasspy/piper-voices/resolve/main/hi/hi_IN/rohan/medium/hi_IN-rohan-medium.onnx.json \
-O /opt/piper/voices/hi_IN-rohan-medium.onnx.json
# Copy startup script
COPY start_hf.sh /app/start_hf.sh
# Env defaults
ENV PORT=7860
ENV PROVIDER=groq
ENV PIPER_BINARY=/opt/piper/piper
ENV PIPER_VOICE_DIR=/opt/piper/voices
ENV LIBRETRANSLATE_URL=http://localhost:5000/translate
EXPOSE 7860
CMD ["/app/start_hf.sh"]
|