Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +8 -5
Dockerfile
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
|
|
| 1 |
FROM python:3.10-alpine
|
| 2 |
|
| 3 |
-
# 1. Install build
|
| 4 |
-
#
|
| 5 |
RUN apk add --no-cache \
|
| 6 |
build-base \
|
| 7 |
cmake \
|
| 8 |
musl-dev \
|
|
|
|
|
|
|
| 9 |
libc6-compat \
|
| 10 |
libstdc++ \
|
| 11 |
libgomp \
|
|
@@ -18,12 +21,12 @@ ENV HOME=/home/user \
|
|
| 18 |
PATH=/home/user/.local/bin:$PATH
|
| 19 |
WORKDIR $HOME/app
|
| 20 |
|
| 21 |
-
# 2.
|
| 22 |
ENV CMAKE_ARGS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS"
|
| 23 |
|
| 24 |
# 3. Install packages
|
| 25 |
-
#
|
| 26 |
-
#
|
| 27 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 28 |
pip install --no-cache-dir flask flask-cors huggingface-hub && \
|
| 29 |
pip install --no-cache-dir llama-cpp-python
|
|
|
|
| 1 |
+
# Use a specific version for better stability
|
| 2 |
FROM python:3.10-alpine
|
| 3 |
|
| 4 |
+
# 1. Install EVERY build dependency needed for a C++ compile on Alpine
|
| 5 |
+
# we add linux-headers and python3-dev to prevent "missing header" errors
|
| 6 |
RUN apk add --no-cache \
|
| 7 |
build-base \
|
| 8 |
cmake \
|
| 9 |
musl-dev \
|
| 10 |
+
python3-dev \
|
| 11 |
+
linux-headers \
|
| 12 |
libc6-compat \
|
| 13 |
libstdc++ \
|
| 14 |
libgomp \
|
|
|
|
| 21 |
PATH=/home/user/.local/bin:$PATH
|
| 22 |
WORKDIR $HOME/app
|
| 23 |
|
| 24 |
+
# 2. Tell the compiler to use Alpine's math libraries
|
| 25 |
ENV CMAKE_ARGS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS"
|
| 26 |
|
| 27 |
# 3. Install packages
|
| 28 |
+
# WARNING: This will take 15 minutes. The logs will look "stuck".
|
| 29 |
+
# DO NOT REBOOT. Let it finish the "Building wheel" stage.
|
| 30 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 31 |
pip install --no-cache-dir flask flask-cors huggingface-hub && \
|
| 32 |
pip install --no-cache-dir llama-cpp-python
|