AIencoder commited on
Commit
4ef2ef4
·
verified ·
1 Parent(s): 41ca118

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -10
Dockerfile CHANGED
@@ -1,30 +1,32 @@
 
 
 
 
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. FIX: Move the llama-server binary to a global path
14
- # The 'full' image builds binaries in /llama.cpp/build/bin/
15
- RUN cp /llama-server /usr/local/bin/llama-server
16
-
17
  # 4. Install Python Libraries
18
  RUN pip3 install --no-cache-dir huggingface_hub
19
 
20
  # 5. Copy and Fix the Start Script
21
  COPY start.sh /app/start.sh
22
-
23
- # FIX: Convert Windows line endings to Unix and make executable
24
  RUN dos2unix /app/start.sh && chmod +x /app/start.sh
25
 
26
- # FIX: Give permission to the folder and create cache directory
27
  RUN mkdir -p /app/.cache && chmod -R 777 /app
28
 
29
- # 6. Start
30
  ENTRYPOINT [ "/app/start.sh" ]
 
1
+ # Stage 1: Grab the server binary from the official server image
2
+ FROM ghcr.io/ggml-org/llama.cpp:server AS source
3
+
4
+ # Stage 2: Setup your environment using the full image (which has the OS tools you need)
5
  FROM ghcr.io/ggml-org/llama.cpp:full
6
 
7
+ # 1. COPY the missing binary from Stage 1 to your system path
8
+ # The server image keeps it at /llama-server (root), so we copy it to /usr/local/bin
9
+ COPY --from=source /llama-server /usr/local/bin/llama-server
10
+
11
+ # 2. Setup Environment
12
  WORKDIR /app
13
  ENV HF_HOME=/app/.cache
14
  ENV NUMBA_CACHE_DIR=/app/.cache
15
 
16
+ # 3. Install Python & Fix Permissions Tools
17
  RUN apt-get update && \
18
  apt-get install -y python3 python3-pip dos2unix && \
19
  rm -rf /var/lib/apt/lists/*
20
 
 
 
 
 
21
  # 4. Install Python Libraries
22
  RUN pip3 install --no-cache-dir huggingface_hub
23
 
24
  # 5. Copy and Fix the Start Script
25
  COPY start.sh /app/start.sh
 
 
26
  RUN dos2unix /app/start.sh && chmod +x /app/start.sh
27
 
28
+ # 6. Permissions
29
  RUN mkdir -p /app/.cache && chmod -R 777 /app
30
 
31
+ # 7. Start
32
  ENTRYPOINT [ "/app/start.sh" ]