# Base image with Python FROM python:3.13 # Install system dependencies RUN apt-get update && apt-get install -y \ ffmpeg \ git \ && rm -rf /var/lib/apt/lists/* # Create a non-root user for Hugging Face Spaces RUN useradd -m -u 1000 user USER user # Add local pip binaries to PATH ENV PATH="/home/user/.local/bin:$PATH" # Set working directory WORKDIR /app # Install dependencies COPY --chown=user requirements.txt . RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copy all app files COPY --chown=user . . # Expose Space’s required port EXPOSE 7860 # Default command to run FastAPI with Uvicorn CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]