Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- 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
|
| 27 |
# --------------------------------------------
|
| 28 |
COPY requirements.txt .
|
| 29 |
|
| 30 |
-
#
|
|
|
|
|
|
|
| 31 |
RUN pip install --no-cache-dir --upgrade pip setuptools wheel cython
|
| 32 |
|
| 33 |
-
#
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
-
#
|
| 38 |
-
|
|
|
|
|
|
|
| 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
|
| 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
|
| 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
|
| 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
|
| 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 |
|