Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -12
Dockerfile
CHANGED
|
@@ -1,29 +1,30 @@
|
|
| 1 |
-
#
|
| 2 |
-
|
|
|
|
| 3 |
|
| 4 |
-
# Install
|
| 5 |
-
|
| 6 |
-
RUN apk add --no-cache \
|
| 7 |
curl \
|
| 8 |
git \
|
| 9 |
nodejs \
|
| 10 |
npm \
|
| 11 |
-
|
| 12 |
-
g++ \
|
| 13 |
-
musl-dev
|
| 14 |
|
| 15 |
# Install promptfoo globally
|
| 16 |
RUN npm install -g promptfoo
|
| 17 |
|
| 18 |
WORKDIR /app
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
#
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
| 23 |
"llama-cpp-python" \
|
| 24 |
--extra-index-url "https://abetlen.github.io/llama-cpp-python/whl/cpu"
|
| 25 |
|
| 26 |
-
# Install
|
| 27 |
COPY requirements.txt .
|
| 28 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 29 |
|
|
|
|
| 1 |
+
# Use Python 3.11 Slim (Debian-based)
|
| 2 |
+
# WHY: The pre-built AI engine is built for Debian (glibc), not Alpine (musl).
|
| 3 |
+
FROM python:3.11-slim
|
| 4 |
|
| 5 |
+
# Install Node.js (for promptfoo) and system tools
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
|
|
|
| 7 |
curl \
|
| 8 |
git \
|
| 9 |
nodejs \
|
| 10 |
npm \
|
| 11 |
+
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# Install promptfoo globally
|
| 14 |
RUN npm install -g promptfoo
|
| 15 |
|
| 16 |
WORKDIR /app
|
| 17 |
|
| 18 |
+
# --- CRITICAL INSTALLATION STEP ---
|
| 19 |
+
# We install the AI engine separately with three safety flags:
|
| 20 |
+
# 1. --extra-index-url: Points to the pre-built CPU library.
|
| 21 |
+
# 2. --only-binary :all: STRICTLY forbids compilation. If the pre-built file isn't found, it will error immediately (fail fast) rather than trying to compile for 30 mins.
|
| 22 |
+
# 3. --no-cache-dir: Keeps the image small.
|
| 23 |
+
RUN pip install --no-cache-dir --only-binary :all: \
|
| 24 |
"llama-cpp-python" \
|
| 25 |
--extra-index-url "https://abetlen.github.io/llama-cpp-python/whl/cpu"
|
| 26 |
|
| 27 |
+
# --- Install Standard Requirements ---
|
| 28 |
COPY requirements.txt .
|
| 29 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 30 |
|