Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -12
Dockerfile
CHANGED
|
@@ -1,30 +1,31 @@
|
|
| 1 |
-
FROM python:3.10-
|
| 2 |
|
| 3 |
-
# Install
|
| 4 |
-
RUN apt-get update && apt-get install -y
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
#
|
| 7 |
RUN useradd -m -u 1000 user
|
| 8 |
ENV HOME=/home/user \
|
| 9 |
PATH=/home/user/.local/bin:$PATH
|
| 10 |
-
|
| 11 |
WORKDIR $HOME/app
|
| 12 |
|
| 13 |
-
# Pre-create
|
| 14 |
RUN mkdir -p $HOME/app/model_cache && chown -R user:user $HOME/app
|
| 15 |
-
|
| 16 |
USER user
|
| 17 |
|
| 18 |
-
# Install
|
| 19 |
RUN pip install --no-cache-dir \
|
| 20 |
https://github.com/mrzeeshanahmed/llama-cpp-python/releases/download/v0.3.17-manylinux-x86_64/llama_cpp_python-0.3.17-cp310-cp310-manylinux_2_17_x86_64.whl \
|
| 21 |
huggingface-hub \
|
| 22 |
hf-transfer \
|
| 23 |
-
ipython \
|
| 24 |
numpy
|
| 25 |
|
| 26 |
-
# Copy
|
| 27 |
COPY --chown=user . .
|
| 28 |
|
| 29 |
-
#
|
| 30 |
-
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
FROM python:3.10-bookworm
|
| 2 |
|
| 3 |
+
# Install essential build tools just in case
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
curl \
|
| 6 |
+
git \
|
| 7 |
+
procps \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
+
# Standard Hugging Face user setup
|
| 11 |
RUN useradd -m -u 1000 user
|
| 12 |
ENV HOME=/home/user \
|
| 13 |
PATH=/home/user/.local/bin:$PATH
|
|
|
|
| 14 |
WORKDIR $HOME/app
|
| 15 |
|
| 16 |
+
# Pre-create and set permissions
|
| 17 |
RUN mkdir -p $HOME/app/model_cache && chown -R user:user $HOME/app
|
|
|
|
| 18 |
USER user
|
| 19 |
|
| 20 |
+
# Install the wheel and core tools
|
| 21 |
RUN pip install --no-cache-dir \
|
| 22 |
https://github.com/mrzeeshanahmed/llama-cpp-python/releases/download/v0.3.17-manylinux-x86_64/llama_cpp_python-0.3.17-cp310-cp310-manylinux_2_17_x86_64.whl \
|
| 23 |
huggingface-hub \
|
| 24 |
hf-transfer \
|
|
|
|
| 25 |
numpy
|
| 26 |
|
| 27 |
+
# Copy files
|
| 28 |
COPY --chown=user . .
|
| 29 |
|
| 30 |
+
# Use -u for unbuffered logs so you see progress in real-time
|
| 31 |
+
CMD ["python", "-u", "app.py"]
|