# Base image FROM python:3.10-slim # Environment setup ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Install dependencies including libGL RUN apt-get update && apt-get install -y \ build-essential \ libglib2.0-0 \ libsm6 \ libxrender1 \ libxext6 \ libgl1 \ && rm -rf /var/lib/apt/lists/* # Set work directory WORKDIR /app # Install Python dependencies COPY requirements.txt . RUN pip install --upgrade pip RUN pip install -r requirements.txt # Copy project files COPY . . # Expose port EXPOSE 7860 # Start the FastAPI app CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]