Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +16 -8
Dockerfile
CHANGED
|
@@ -1,19 +1,27 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
-
RUN pip install --no-cache-dir gradio huggingface_hub
|
| 7 |
|
| 8 |
-
# Set up the
|
| 9 |
RUN useradd -m -u 1000 user
|
| 10 |
USER user
|
| 11 |
ENV HOME=/home/user \
|
| 12 |
PATH=/home/user/.local/bin:$PATH
|
| 13 |
WORKDIR $HOME/app
|
| 14 |
|
| 15 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
COPY --chown=user . $HOME/app
|
| 17 |
|
| 18 |
-
#
|
| 19 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
# Standard image that Hugging Face always has in stock
|
| 2 |
+
FROM python:3.10-slim-bullseye
|
| 3 |
|
| 4 |
+
# Install the ONLY system library needed for the math engine
|
| 5 |
+
RUN apt-get update && apt-get install -y libgomp1 curl && rm -rf /var/lib/apt/lists/*
|
|
|
|
| 6 |
|
| 7 |
+
# Set up the HF user
|
| 8 |
RUN useradd -m -u 1000 user
|
| 9 |
USER user
|
| 10 |
ENV HOME=/home/user \
|
| 11 |
PATH=/home/user/.local/bin:$PATH
|
| 12 |
WORKDIR $HOME/app
|
| 13 |
|
| 14 |
+
# Force install the PRE-BUILT CPU binary for Python 3.10
|
| 15 |
+
# This skips the 40-minute compilation entirely
|
| 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 |
+
# Install Gradio and HF Hub
|
| 21 |
+
RUN pip install --no-cache-dir gradio huggingface_hub
|
| 22 |
+
|
| 23 |
+
# Copy your code
|
| 24 |
COPY --chown=user . $HOME/app
|
| 25 |
|
| 26 |
+
# Port 7860 is mandatory for HF Docker
|
| 27 |
CMD ["python", "app.py"]
|