Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -9
Dockerfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
# Use
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
# Install Node.js (
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
curl \
|
| 7 |
git \
|
|
@@ -9,21 +9,22 @@ RUN apt-get update && apt-get install -y \
|
|
| 9 |
npm \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
-
# Install promptfoo globally
|
| 13 |
RUN npm install -g promptfoo
|
| 14 |
|
| 15 |
# Set working directory
|
| 16 |
WORKDIR /app
|
| 17 |
|
| 18 |
-
#
|
| 19 |
COPY requirements.txt .
|
| 20 |
-
|
| 21 |
-
# Install Python dependencies
|
| 22 |
-
# We use --extra-index-url to get the pre-built 'wheel' to avoid compilation timeout
|
| 23 |
-
RUN pip install --no-cache-dir --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu llama-cpp-python
|
| 24 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
|
| 26 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
COPY . .
|
| 28 |
|
| 29 |
# Expose port
|
|
|
|
| 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 |
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
|