# 1. Use a standard Python image FROM python:3.10-slim # 2. Install system dependencies (Updated for Debian Trixie/Hugging Face) RUN apt-get update && apt-get install -y \ libgl1 \ libglib2.0-0 \ ffmpeg \ && rm -rf /var/lib/apt/lists/* # 3. Set up the Hugging Face user (UID 1000) RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app # 4. Copy requirements and install via pip COPY --chown=user requirements.txt . RUN pip install --no-cache-dir --upgrade -r requirements.txt # 5. Copy the rest of the project COPY --chown=user . . # 6. Start the FastAPI server on port 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]