Gokul commited on
Commit
ca51a6c
·
1 Parent(s): b54269e

Switch to Runtime Download

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -4
Dockerfile CHANGED
@@ -9,21 +9,31 @@ RUN useradd -m -u 1000 user
9
  USER user
10
  ENV PATH="/home/user/.local/bin:$PATH"
11
 
12
- # 4. Install system basics
 
13
  USER root
14
- RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
 
 
 
 
15
  USER user
16
 
17
  # 5. Copy requirements
18
  COPY --chown=user requirements.txt .
19
 
20
- # 6. Install Python Dependencies (Pre-built Wheels)
21
  RUN pip install --no-cache-dir --upgrade pip
 
22
  RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
 
 
23
  RUN pip install --no-cache-dir llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
 
 
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
26
- # 7. Copy App Code (BUT DO NOT DOWNLOAD MODEL YET)
27
  COPY --chown=user . .
28
 
29
  # 8. Start Server
 
9
  USER user
10
  ENV PATH="/home/user/.local/bin:$PATH"
11
 
12
+ # 4. Install system dependencies
13
+ # ⚡ FIX: We add 'build-essential' and 'cmake' so it can compile the AI engine
14
  USER root
15
+ RUN apt-get update && apt-get install -y \
16
+ build-essential \
17
+ cmake \
18
+ curl \
19
+ && rm -rf /var/lib/apt/lists/*
20
  USER user
21
 
22
  # 5. Copy requirements
23
  COPY --chown=user requirements.txt .
24
 
25
+ # 6. Install Python Dependencies
26
  RUN pip install --no-cache-dir --upgrade pip
27
+ # We install torch first
28
  RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
29
+
30
+ # ⚡ This will now compile successfully because we added the tools above
31
  RUN pip install --no-cache-dir llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
32
+
33
+ # Install the rest
34
  RUN pip install --no-cache-dir -r requirements.txt
35
 
36
+ # 7. Copy App Code (Model download happens at Runtime now)
37
  COPY --chown=user . .
38
 
39
  # 8. Start Server