# Python 3.11: the version this image has been built and run with FROM python:3.11-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ git \ git-lfs \ ffmpeg \ libsm6 \ libxext6 \ libgomp1 \ && rm -rf /var/lib/apt/lists/* \ && git lfs install # Create user for HF Spaces RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app # Copy requirements and install dependencies COPY --chown=user requirements.txt . RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copy application code COPY --chown=user . . # Expose port EXPOSE 7860 # Run the API via uvicorn (FastAPI only, no web interface) CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]