Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +15 -7
Dockerfile
CHANGED
|
@@ -1,18 +1,26 @@
|
|
| 1 |
FROM ghcr.io/ggml-org/llama.cpp:full
|
|
|
|
|
|
|
| 2 |
WORKDIR /app
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
# Install Python
|
| 5 |
-
# We clean up apt lists to keep the layer small and prevent errors
|
| 6 |
RUN apt-get update && \
|
| 7 |
-
apt-get install -y python3 python3-pip && \
|
| 8 |
rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
# Install
|
| 11 |
RUN pip3 install --no-cache-dir huggingface_hub
|
| 12 |
|
| 13 |
-
# Copy the
|
| 14 |
COPY start.sh /app/start.sh
|
| 15 |
-
RUN chmod +x /app/start.sh
|
| 16 |
|
| 17 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
ENTRYPOINT ["/app/start.sh"]
|
|
|
|
| 1 |
FROM ghcr.io/ggml-org/llama.cpp:full
|
| 2 |
+
|
| 3 |
+
# 1. Setup Environment
|
| 4 |
WORKDIR /app
|
| 5 |
+
ENV HF_HOME=/app/.cache
|
| 6 |
+
ENV NUMBA_CACHE_DIR=/app/.cache
|
| 7 |
|
| 8 |
+
# 2. Install Python & Fix Permissions Tools
|
|
|
|
| 9 |
RUN apt-get update && \
|
| 10 |
+
apt-get install -y python3 python3-pip dos2unix && \
|
| 11 |
rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
+
# 3. Install Python Libraries
|
| 14 |
RUN pip3 install --no-cache-dir huggingface_hub
|
| 15 |
|
| 16 |
+
# 4. Copy and Fix the Start Script
|
| 17 |
COPY start.sh /app/start.sh
|
|
|
|
| 18 |
|
| 19 |
+
# FIX: Convert Windows line endings to Unix and make executable
|
| 20 |
+
RUN dos2unix /app/start.sh && chmod +x /app/start.sh
|
| 21 |
+
|
| 22 |
+
# FIX: Give permission to the folder so the user can download models
|
| 23 |
+
RUN chmod -R 777 /app
|
| 24 |
+
|
| 25 |
+
# 5. Start
|
| 26 |
ENTRYPOINT ["/app/start.sh"]
|