Peter Mutwiri commited on
Commit
94ec424
·
1 Parent(s): 6352c84

ix: correct duckdb typo and pre-download VSS extension

Browse files
Files changed (1) hide show
  1. Dockerfile +39 -0
Dockerfile CHANGED
@@ -1,6 +1,20 @@
1
  # ---- 1. base image ---------------------------------------------------------
2
  FROM python:3.11-slim
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  # ---- 2. system dependencies for binary wheels ------------------------------
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  build-essential \
@@ -36,5 +50,30 @@ WORKDIR /app
36
  # ---- 7. scheduler loop ----------------------------------------------------
37
  COPY scheduler_loop.py /app/scheduler_loop.py
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  # ---- 8. start both services -----------------------------------------------
40
  CMD sh -c "python -m uvicorn app.main:app --host 0.0.0.0 --port 7860 & python /app/scheduler_loop.py"
 
1
  # ---- 1. base image ---------------------------------------------------------
2
  FROM python:3.11-slim
3
 
4
+ # ---- 2. system dependencies for binary wheels ------------------------------
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ build-essential \
7
+ gcc \
8
+ g++ \
9
+ cmake \
10
+ libgomp1 \
11
+ libstdc++6 \
12
+ ca-certificates \
13
+ wget \
14
+ unzip \
15
+ && rm -rf /var/lib/apt/lists/*# ---- 1. base image ---------------------------------------------------------
16
+ FROM python:3.11-slim
17
+
18
  # ---- 2. system dependencies for binary wheels ------------------------------
19
  RUN apt-get update && apt-get install -y --no-install-recommends \
20
  build-essential \
 
50
  # ---- 7. scheduler loop ----------------------------------------------------
51
  COPY scheduler_loop.py /app/scheduler_loop.py
52
 
53
+ # ---- 8. start both services -----------------------------------------------
54
+ CMD sh -c "python -m uvicorn app.main:app --host 0.0.0.0 --port 7860 & python /app/scheduler_loop.py"
55
+
56
+ # ---- 3. upgrade pip & enable pre-built wheels ------------------------------
57
+ RUN pip install --no-cache-dir --upgrade pip setuptools wheel
58
+
59
+ # ---- 4. install Python deps (+ DuckDB driver) ------------------------------
60
+ COPY requirements.txt /tmp/requirements.txt
61
+ RUN pip install --no-cache-dir --prefer-binary -r /tmp/requirements.txt && \
62
+ pip install --no-cache-dir duckdb==0.10.3
63
+
64
+ # ---- 5. Pre-download VSS extension (matches DuckDB v0.10.3) ---------------
65
+ # This prevents runtime download failures and startup crashes
66
+ RUN mkdir -p /root/.duckdb/extensions/v0.10.3/linux_amd64_gcc4 && \
67
+ wget -q https://extensions.duckdb.org/v0.10.3/linux_amd64_gcc4/vss.duckdb_extension.gz \
68
+ -O /root/.duckdb/extensions/v0.10.3/linux_amd64_gcc4/vss.duckdb_extension.gz && \
69
+ gunzip /root/.duckdb/extensions/v0.10.3/linux_amd64_gcc4/vss.duckdb_extension.gz
70
+
71
+ # ---- 6. copy source --------------------------------------------------------
72
+ COPY . /app
73
+ WORKDIR /app
74
+
75
+ # ---- 7. scheduler loop ----------------------------------------------------
76
+ COPY scheduler_loop.py /app/scheduler_loop.py
77
+
78
  # ---- 8. start both services -----------------------------------------------
79
  CMD sh -c "python -m uvicorn app.main:app --host 0.0.0.0 --port 7860 & python /app/scheduler_loop.py"