# Start with a lightweight Python version FROM python:3.9-slim # Set the working directory WORKDIR /code # 1. Install System Dependencies # FIX: Removed 'libgl1-mesa-glx' (obsolete). Added 'libgl1' and 'libglx-mesa0'. RUN apt-get update && apt-get install -y \ libgl1 \ libglx-mesa0 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # 2. Copy the requirements file COPY ./requirements.txt /code/requirements.txt # 3. Install Python libraries RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # 4. Copy your code and model COPY . . # 5. Create a folder for uploads just in case RUN mkdir -p /code/uploads && chmod 777 /code/uploads # 6. Start the server CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]