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"]