# Ultra-minimal Dockerfile for HF Spaces FROM python:3.11-slim # Set working directory WORKDIR /app # Install minimal system packages RUN apt-get update && apt-get install -y --no-install-recommends \ curl \ && rm -rf /var/lib/apt/lists/* \ && apt-get clean # Create non-root user RUN useradd -m -u 1000 user # Switch to user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app # Copy and install minimal requirements (without webrtcvad) COPY --chown=user requirements-minimal.txt . RUN pip install --user --no-cache-dir -r requirements-minimal.txt # Copy application code COPY --chown=user . . # Expose port EXPOSE 7860 # Environment variables ENV GRADIO_SERVER_NAME="0.0.0.0" \ GRADIO_SERVER_PORT=7860 # Run simplified Streamlit app with direct STT connection on HF port 7860 CMD ["streamlit", "run", "streamlit_websocket_app.py", "--server.port", "7860", "--server.address", "0.0.0.0", "--server.headless", "true"]