Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -8
Dockerfile
CHANGED
|
@@ -1,28 +1,30 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
# Install system
|
| 4 |
RUN apt-get update && apt-get install -y curl git && rm -rf /var/lib/apt/lists/*
|
| 5 |
|
| 6 |
-
# Set up user and
|
| 7 |
RUN useradd -m -u 1000 user
|
| 8 |
ENV HOME=/home/user \
|
| 9 |
PATH=/home/user/.local/bin:$PATH
|
| 10 |
|
| 11 |
-
# Create the app directory and set permissions BEFORE switching users
|
| 12 |
WORKDIR $HOME/app
|
| 13 |
-
|
|
|
|
|
|
|
| 14 |
|
| 15 |
USER user
|
| 16 |
|
| 17 |
-
# Install the pre-compiled wheel
|
| 18 |
RUN pip install --no-cache-dir \
|
| 19 |
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 \
|
| 20 |
huggingface-hub \
|
| 21 |
hf-transfer \
|
| 22 |
-
ipython
|
|
|
|
| 23 |
|
| 24 |
-
# Copy
|
| 25 |
COPY --chown=user . .
|
| 26 |
|
| 27 |
-
#
|
| 28 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Install system dependencies
|
| 4 |
RUN apt-get update && apt-get install -y curl git && rm -rf /var/lib/apt/lists/*
|
| 5 |
|
| 6 |
+
# Set up user and environment
|
| 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 cache directory with correct permissions
|
| 14 |
+
RUN mkdir -p $HOME/app/model_cache && chown -R user:user $HOME/app
|
| 15 |
|
| 16 |
USER user
|
| 17 |
|
| 18 |
+
# Install libraries (using the pre-compiled wheel for llama-cpp)
|
| 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 application files
|
| 27 |
COPY --chown=user . .
|
| 28 |
|
| 29 |
+
# Run the script
|
| 30 |
CMD ["python", "app.py"]
|