FROM python:3.10-slim # WORKDIR /app # Install system deps RUN apt-get update && apt-get install -y \ libgl1 \ && rm -rf /var/lib/apt/lists/* COPY . . RUN pip install --no-cache-dir -r requirements.txt # HF expects app on port 7860 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] # FROM python:3.10-slim # # Prevent Python from buffering stdout/stderr # ENV PYTHONUNBUFFERED=1 # # Set working directory # WORKDIR /app # # Install required system libraries # RUN apt-get update && apt-get install -y --no-install-recommends \ # libglib2.0-0 \ # libgl1 \ # libsm6 \ # libxext6 \ # libxrender1 \ # && rm -rf /var/lib/apt/lists/* # # Copy requirements first for better Docker layer caching # COPY requirements.txt . # RUN pip install --no-cache-dir -r requirements.txt # # Copy the rest of the application # COPY . . # # Hugging Face Spaces uses port 7860 # EXPOSE 7860 # CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]