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"]