Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +12 -8
Dockerfile
CHANGED
|
@@ -1,25 +1,29 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
# Install
|
| 4 |
-
|
|
|
|
| 5 |
curl \
|
| 6 |
git \
|
| 7 |
nodejs \
|
| 8 |
npm \
|
| 9 |
-
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# Install promptfoo globally
|
| 12 |
RUN npm install -g promptfoo
|
| 13 |
|
| 14 |
WORKDIR /app
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
#
|
| 18 |
RUN pip install --no-cache-dir \
|
| 19 |
-
"llama-cpp-python
|
| 20 |
--extra-index-url "https://abetlen.github.io/llama-cpp-python/whl/cpu"
|
| 21 |
|
| 22 |
-
#
|
| 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 |
|