1
0
forked from eoeair/cenv
cenv/llama/cpu/Dockerfile
pdch 4572633365 add llama-server
更新 Dockerfile,修正工作目录路径并添加健康检查和入口点
2024-12-23 16:10:16 +08:00

25 lines
734 B
Docker

FROM eoelab.org:1027/ben0i0d/cenv:base
USER root
RUN apt-get update --yes && apt-get install --yes gcc gdb cmake build-essential git libcurl4-openssl-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR "${HOME}"
# install llama
RUN git clone https://github.com/ggerganov/llama.cpp.git
WORKDIR /llama.cpp
RUN cmake -S . -B build -DGGML_BACKEND_DL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ALL_VARIANTS=ON -DLLAMA_CURL=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF && \
cmake --build build -j $(nproc)
WORKDIR "${HOME}"
RUN mv /llama.cpp/build/bin/llama-server /usr/local/bin/llama-server && \
rm -rf /llama.cpp
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
ENTRYPOINT [ "llama-server" ]