File size: 714 Bytes
b7edcbf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
ARG UBUNTU_VERSION=22.04
ARG BASE_CPU_CONTAINER=ubuntu:${UBUNTU_VERSION}

FROM ${BASE_CPU_CONTAINER} as build

RUN apt-get update && \
    apt-get install -y build-essential git make cmake wget && \
    git clone https://github.com/ggerganov/llama.cpp.git /build/llama.cpp && \
    cd /build/llama.cpp && \
    make llama-server && \
    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

FROM ${BASE_CPU_CONTAINER} as runtime

WORKDIR /app

COPY --from=build /build/llama.cpp/llama-server /app/llama-server
COPY --from=build /data/model.gguf /data/model.gguf
COPY ./run.sh /app/run.sh

EXPOSE 7860

RUN chmod +x run.sh

CMD ["./run.sh"]