# Dockerfile for the Backend API # 1. Start with a modern, lightweight Python version. FROM python:3.11-slim # 2. Set the working directory inside the container. WORKDIR /code # 3. FIX: Update package lists and install the missing graphics library for OpenCV. RUN apt-get update && apt-get install -y libgl1-mesa-glx # 4. Copy the requirements file and install Python dependencies. COPY ./requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # 5. Copy all your application files (backend_app.py, best.pt) into the container. COPY . /code/ # 6. The command that tells the server how to run your FastAPI app. CMD ["uvicorn", "backend_app:app", "--host", "0.0.0.0", "--port", "7860"]