5fp commited on
Commit
5370d8d
1 Parent(s): 9b189c9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -8
Dockerfile CHANGED
@@ -4,22 +4,35 @@ ARG BASE_CPU_CONTAINER=ubuntu:${UBUNTU_VERSION}
4
  FROM ${BASE_CPU_CONTAINER} as build
5
 
6
  RUN apt-get update && \
7
- apt-get install -y build-essential git make cmake wget && \
8
- git clone https://github.com/ggerganov/llama.cpp.git /build/llama.cpp && \
9
- cd /build/llama.cpp && \
10
- make llama-server && \
11
- wget -nv https://huggingface.co/Green-Sky/TriLM_3.9B-GGUF/resolve/main/TriLM_3.9B_Unpacked-4.0B-TQ2_0.gguf -O /data/model.gguf
 
 
 
 
 
 
 
 
 
 
12
 
13
  FROM ${BASE_CPU_CONTAINER} as runtime
14
 
15
  WORKDIR /app
16
 
17
- COPY --from=build /build/llama.cpp/llama-server /app/llama-server
 
18
  COPY --from=build /data/model.gguf /data/model.gguf
19
  COPY ./run.sh /app/run.sh
20
-
21
  EXPOSE 7860
22
 
 
23
  RUN chmod +x run.sh
24
 
25
- CMD ["./run.sh"]
 
 
4
  FROM ${BASE_CPU_CONTAINER} as build
5
 
6
  RUN apt-get update && \
7
+ apt-get install -y build-essential git make cmake wget
8
+
9
+ WORKDIR /build
10
+
11
+ RUN git clone https://github.com/ggerganov/llama.cpp.git
12
+
13
+ WORKDIR /build/llama.cpp
14
+
15
+
16
+ ENV LDFLAGS="-static"
17
+
18
+ RUN make llama-server
19
+
20
+ WORKDIR /data
21
+ RUN wget https://huggingface.co/Green-Sky/TriLM_3.9B-GGUF/resolve/main/TriLM_3.9B_Unpacked-4.0B-TQ2_0.gguf -nv -O model.gguf
22
 
23
  FROM ${BASE_CPU_CONTAINER} as runtime
24
 
25
  WORKDIR /app
26
 
27
+ # Copy the executable from the build stage
28
+ COPY --from=build /build/llama.cpp/llama-server /app
29
  COPY --from=build /data/model.gguf /data/model.gguf
30
  COPY ./run.sh /app/run.sh
31
+ WORKDIR /app
32
  EXPOSE 7860
33
 
34
+ # Make the script executable
35
  RUN chmod +x run.sh
36
 
37
+ # CMD to run your script
38
+ CMD ./run.sh