dipan004 commited on
Commit
02a4759
·
verified ·
1 Parent(s): d19f573

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -11
Dockerfile CHANGED
@@ -23,19 +23,27 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
23
  RUN tesseract --version
24
 
25
  # --------------------------------------------
26
- # Copy requirements and prepare Python environment
27
  # --------------------------------------------
28
  COPY requirements.txt .
29
 
30
- # Upgrade build tools
 
 
31
  RUN pip install --no-cache-dir --upgrade pip setuptools wheel cython
32
 
33
- # 🔧 FIX: NumPy–Pandas binary compatibility
34
- RUN pip install --no-cache-dir numpy==1.24.4
35
- RUN pip install --no-cache-dir --no-binary=pandas pandas==2.0.3
 
 
 
 
36
 
37
- # Install remaining dependencies from requirements.txt
38
- RUN pip install --no-cache-dir -r requirements.txt
 
 
39
 
40
  # Upgrade Gemini SDK for v1 API
41
  RUN pip install --no-cache-dir --upgrade google-generativeai google-ai-generativelanguage
@@ -54,7 +62,7 @@ COPY . .
54
  RUN mkdir -p /app/data/logs /app/data/docs /app/backend/app/db && chmod -R 777 /app/data
55
 
56
  # --------------------------------------------
57
- # Create __init__.py files for all packages
58
  # --------------------------------------------
59
  RUN touch backend/__init__.py \
60
  && touch backend/feature_builder/__init__.py \
@@ -65,12 +73,12 @@ RUN touch backend/__init__.py \
65
  && touch backend/app/db/__init__.py \
66
  && touch backend/ingest/__init__.py
67
 
68
- # Verify agent files exist (fail build if missing)
69
  RUN test -f backend/app/agent/agent_orchestrator.py || \
70
  (echo "ERROR: agent_orchestrator.py not found! Add it before building." && exit 1)
71
 
72
  # --------------------------------------------
73
- # Initialize database during build
74
  # --------------------------------------------
75
  COPY backend/app/db/db_init.py backend/app/db/db_init.py
76
  RUN echo "🗄️ Initializing database during build..." && \
@@ -78,7 +86,7 @@ RUN echo "🗄️ Initializing database during build..." && \
78
  echo "✅ Database initialized successfully!"
79
 
80
  # --------------------------------------------
81
- # Expose application port
82
  # --------------------------------------------
83
  EXPOSE 7860
84
 
 
23
  RUN tesseract --version
24
 
25
  # --------------------------------------------
26
+ # Copy requirements
27
  # --------------------------------------------
28
  COPY requirements.txt .
29
 
30
+ # --------------------------------------------
31
+ # Upgrade pip + build tools
32
+ # --------------------------------------------
33
  RUN pip install --no-cache-dir --upgrade pip setuptools wheel cython
34
 
35
+ # --------------------------------------------
36
+ # 🔧 Fix NumPy/Pandas binary compatibility
37
+ # 1️⃣ Install NumPy first (stable ABI)
38
+ # 2️⃣ Install Pandas from source against installed NumPy
39
+ # --------------------------------------------
40
+ RUN pip install --no-cache-dir --upgrade --force-reinstall numpy==1.24.4
41
+ RUN pip install --no-cache-dir --upgrade --force-reinstall --no-binary :all: pandas==2.0.3
42
 
43
+ # --------------------------------------------
44
+ # Install remaining dependencies WITHOUT touching numpy/pandas
45
+ # --------------------------------------------
46
+ RUN pip install --no-cache-dir --upgrade --ignore-installed -r requirements.txt
47
 
48
  # Upgrade Gemini SDK for v1 API
49
  RUN pip install --no-cache-dir --upgrade google-generativeai google-ai-generativelanguage
 
62
  RUN mkdir -p /app/data/logs /app/data/docs /app/backend/app/db && chmod -R 777 /app/data
63
 
64
  # --------------------------------------------
65
+ # Create __init__.py files
66
  # --------------------------------------------
67
  RUN touch backend/__init__.py \
68
  && touch backend/feature_builder/__init__.py \
 
73
  && touch backend/app/db/__init__.py \
74
  && touch backend/ingest/__init__.py
75
 
76
+ # Verify agent files exist
77
  RUN test -f backend/app/agent/agent_orchestrator.py || \
78
  (echo "ERROR: agent_orchestrator.py not found! Add it before building." && exit 1)
79
 
80
  # --------------------------------------------
81
+ # Initialize database
82
  # --------------------------------------------
83
  COPY backend/app/db/db_init.py backend/app/db/db_init.py
84
  RUN echo "🗄️ Initializing database during build..." && \
 
86
  echo "✅ Database initialized successfully!"
87
 
88
  # --------------------------------------------
89
+ # Expose port
90
  # --------------------------------------------
91
  EXPOSE 7860
92