FROM python:3.10-slim # System dependencies RUN apt-get update && apt-get install -y \ git \ ffmpeg \ libsm6 \ libxext6 \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Create user (HuggingFace requires non-root) RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR /home/user/app # Install Python deps COPY --chown=user requirements.txt . RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copy app files COPY --chown=user . . EXPOSE 7860 CMD ["streamlit", "run", "app/app.py", \ "--server.port=7860", \ "--server.address=0.0.0.0", \ "--server.headless=true", \ "--server.fileWatcherType=none"]