File size: 1,110 Bytes
6e01276
 
 
 
 
 
9b4983c
6e01276
9b4983c
6e01276
 
939163a
 
 
 
 
 
6e01276
 
 
 
 
 
939163a
6e01276
 
 
 
 
 
939163a
6e01276
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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"]