Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -14
Dockerfile
CHANGED
|
@@ -1,27 +1,30 @@
|
|
| 1 |
-
# Use
|
| 2 |
-
FROM python:3.10-
|
| 3 |
|
| 4 |
-
# Install
|
| 5 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
# Set up the HF user
|
| 8 |
-
RUN
|
| 9 |
USER user
|
| 10 |
ENV HOME=/home/user \
|
| 11 |
PATH=/home/user/.local/bin:$PATH
|
| 12 |
WORKDIR $HOME/app
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
# This avoids the 'musl' error and the 40-minute build timeout
|
| 16 |
RUN pip install --no-cache-dir \
|
| 17 |
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
|
| 18 |
-
llama-cpp-python==0.2.90
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
RUN pip install --no-cache-dir gradio huggingface_hub
|
| 22 |
-
|
| 23 |
-
# Copy app files
|
| 24 |
COPY --chown=user . $HOME/app
|
| 25 |
|
| 26 |
-
#
|
| 27 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
# Use Alpine Linux to natively support the 'musl' wheel that pip is grabbing
|
| 2 |
+
FROM python:3.10-alpine
|
| 3 |
|
| 4 |
+
# Install system dependencies Alpine needs for C++ and model downloading
|
| 5 |
+
RUN apk add --no-cache \
|
| 6 |
+
libstdc++ \
|
| 7 |
+
g++ \
|
| 8 |
+
make \
|
| 9 |
+
cmake \
|
| 10 |
+
curl \
|
| 11 |
+
linux-headers \
|
| 12 |
+
git
|
| 13 |
|
| 14 |
+
# Set up the HF user (Required)
|
| 15 |
+
RUN adduser -D -u 1000 user
|
| 16 |
USER user
|
| 17 |
ENV HOME=/home/user \
|
| 18 |
PATH=/home/user/.local/bin:$PATH
|
| 19 |
WORKDIR $HOME/app
|
| 20 |
|
| 21 |
+
# This will now pull the musl wheel and ACTUALLY run it
|
|
|
|
| 22 |
RUN pip install --no-cache-dir \
|
| 23 |
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
|
| 24 |
+
llama-cpp-python==0.2.90 gradio huggingface_hub
|
| 25 |
|
| 26 |
+
# Copy your files
|
|
|
|
|
|
|
|
|
|
| 27 |
COPY --chown=user . $HOME/app
|
| 28 |
|
| 29 |
+
# Port 7860 is mandatory for HF Docker
|
| 30 |
CMD ["python", "app.py"]
|