PoppaYAO commited on
Commit
e6c8a8d
·
verified ·
1 Parent(s): ba0c553

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -8
Dockerfile CHANGED
@@ -1,25 +1,29 @@
1
- FROM python:3.11-slim
 
2
 
3
- # Install Node.js (for promptfoo) and system tools
4
- RUN apt-get update && apt-get install -y \
 
5
  curl \
6
  git \
7
  nodejs \
8
  npm \
9
- && rm -rf /var/lib/apt/lists/*
 
 
10
 
11
  # Install promptfoo globally
12
  RUN npm install -g promptfoo
13
 
14
  WORKDIR /app
15
 
16
- # --- CRITICAL FIX: Install the AI Engine separately FIRST ---
17
- # We use the specific "CPU" URL to ensure we get the pre-built binary.
18
  RUN pip install --no-cache-dir \
19
- "llama-cpp-python==0.2.90" \
20
  --extra-index-url "https://abetlen.github.io/llama-cpp-python/whl/cpu"
21
 
22
- # --- Install the rest of your requirements ---
23
  COPY requirements.txt .
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
 
1
+ # Switch to Alpine Linux to match the downloaded wheel
2
+ FROM python:3.11-alpine
3
 
4
+ # Install system tools (using 'apk' instead of 'apt-get')
5
+ # We add 'gcc' and 'g++' just in case any other package needs a quick compile
6
+ RUN apk add --no-cache \
7
  curl \
8
  git \
9
  nodejs \
10
  npm \
11
+ gcc \
12
+ g++ \
13
+ musl-dev
14
 
15
  # Install promptfoo globally
16
  RUN npm install -g promptfoo
17
 
18
  WORKDIR /app
19
 
20
+ # Install llama-cpp-python
21
+ # Now that we are on Alpine, the 'musl' wheel it downloaded before will work perfectly.
22
  RUN pip install --no-cache-dir \
23
+ "llama-cpp-python" \
24
  --extra-index-url "https://abetlen.github.io/llama-cpp-python/whl/cpu"
25
 
26
+ # Install your requirements
27
  COPY requirements.txt .
28
  RUN pip install --no-cache-dir -r requirements.txt
29