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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -12
Dockerfile CHANGED
@@ -1,7 +1,6 @@
1
- # Use Python 3.11 slim image
2
  FROM python:3.11-slim
3
 
4
- # 1. Install Node.js (for promptfoo) and basic tools
5
  RUN apt-get update && apt-get install -y \
6
  curl \
7
  git \
@@ -9,25 +8,24 @@ RUN apt-get update && apt-get install -y \
9
  npm \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # 2. Install promptfoo globally
13
  RUN npm install -g promptfoo
14
 
15
- # Set working directory
16
  WORKDIR /app
17
 
18
- # 3. Install Python dependencies (FastAPI, etc.)
 
 
 
 
 
 
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
- # 4. CRITICAL FIX: Install the Pre-Built AI Engine
23
- # We directly download the compiled wheel file so we don't have to compile it (saves 30 mins)
24
- RUN curl -L "https://github.com/abetlen/llama-cpp-python/releases/download/v0.2.90/llama_cpp_python-0.2.90-cp311-cp311-manylinux_2_17_x86_64.whl" -o llama.whl && \
25
- pip install llama.whl
26
-
27
- # 5. Copy your application code
28
  COPY . .
29
 
30
- # Expose port
31
  EXPOSE 7860
32
 
33
  # Run server
 
 
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 \
 
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
 
26
+ # Copy application code
 
 
 
 
 
27
  COPY . .
28
 
 
29
  EXPOSE 7860
30
 
31
  # Run server