Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -10
Dockerfile
CHANGED
|
@@ -1,5 +1,3 @@
|
|
| 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
|
|
@@ -15,14 +13,20 @@ RUN npm install -g promptfoo
|
|
| 15 |
|
| 16 |
WORKDIR /app
|
| 17 |
|
| 18 |
-
# ---
|
| 19 |
-
# We
|
| 20 |
-
# 1.
|
| 21 |
-
# 2.
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
| 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 .
|
|
@@ -33,5 +37,4 @@ COPY . .
|
|
| 33 |
|
| 34 |
EXPOSE 7860
|
| 35 |
|
| 36 |
-
# Run server
|
| 37 |
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
# Install Node.js (for promptfoo) and system tools
|
|
|
|
| 13 |
|
| 14 |
WORKDIR /app
|
| 15 |
|
| 16 |
+
# --- ULTIMATE FIX: Force Specific Platform ---
|
| 17 |
+
# We do not trust pip to choose. We force it to download the 'manylinux' (Debian) version.
|
| 18 |
+
# 1. Download the specific wheel for Debian (manylinux_2_17_x86_64).
|
| 19 |
+
# 2. Install the downloaded file directly.
|
| 20 |
+
RUN pip download --only-binary :all: \
|
| 21 |
+
--platform manylinux_2_17_x86_64 \
|
| 22 |
+
--python-version 311 \
|
| 23 |
+
--implementation cp \
|
| 24 |
+
--abi cp311 \
|
| 25 |
"llama-cpp-python" \
|
| 26 |
+
--extra-index-url "https://abetlen.github.io/llama-cpp-python/whl/cpu" \
|
| 27 |
+
-d /tmp/wheels
|
| 28 |
+
|
| 29 |
+
RUN pip install --no-cache-dir /tmp/wheels/llama*.whl && rm -rf /tmp/wheels
|
| 30 |
|
| 31 |
# --- Install Standard Requirements ---
|
| 32 |
COPY requirements.txt .
|
|
|
|
| 37 |
|
| 38 |
EXPOSE 7860
|
| 39 |
|
|
|
|
| 40 |
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
|