FROM python:3.10 # Install system dependencies RUN apt-get update && apt-get install -y \ ffmpeg \ libsm6 \ libxext6 \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Create non-root user RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" # Set working directory WORKDIR /app # Copy and install requirements COPY --chown=user ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copy application COPY --chown=user . /app # Expose Gradio port EXPOSE 7860 # Run Gradio app CMD ["python", "app.py"]