FROM python:3.11-slim # Set the working directory WORKDIR /app # Install system dependencies required for OpenCV and PaddleOCR # Changed libgl1-mesa-glx to libgl1 which is available in Debian trixie RUN apt-get update && apt-get install -y \ libgl1 \ libglib2.0-0 \ build-essential \ libsm6 \ libxext6 \ libxrender-dev \ wget \ git \ python3-opencv \ && rm -rf /var/lib/apt/lists/* # Copy requirements file first to leverage Docker cache COPY requirements.txt . # Upgrade pip and install Python dependencies RUN pip install --upgrade pip setuptools wheel && \ pip install -r requirements.txt # Copy the rest of the application files COPY backend /app/backend COPY eta_prediction_model.pkl /app/eta_prediction_model.pkl COPY model_columns.pkl /app/model_columns.pkl COPY .env /app/.env # Set up environment variables ENV PYTHONUNBUFFERED=1 # Make sure Python can find modules inside /app ENV PYTHONPATH=/app # Start the FastAPI app using Uvicorn CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]