FROM python:3.12-slim # System dependencies for faster-whisper (ctranslate2) and audio/image processing RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ ffmpeg \ libsndfile1 \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Create non-root user (required by HF Spaces) RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR /home/user/app # Install Python dependencies and the app itself COPY --chown=user . . RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir . # Expose Gradio port EXPOSE 7860 # Run the app CMD ["python", "app.py"]