mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-26 22:30:32 +01:00
59f4db1088
* ggml : add predefined list of CPU backend variants to build * update CPU dockerfiles
34 lines
886 B
Docker
34 lines
886 B
Docker
ARG UBUNTU_VERSION=22.04
|
|
|
|
FROM ubuntu:$UBUNTU_VERSION AS build
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y build-essential git cmake libcurl4-openssl-dev
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
RUN cmake -S . -B build -DGGML_BACKEND_DL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ALL_VARIANTS=ON -DLLAMA_CURL=ON -DCMAKE_BUILD_TYPE=Release && \
|
|
cmake --build build -j $(nproc) && \
|
|
mkdir -p /app/lib && \
|
|
find build -name "*.so" -exec cp {} /app/lib/ \;
|
|
|
|
FROM ubuntu:$UBUNTU_VERSION AS runtime
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y libcurl4-openssl-dev libgomp1 curl
|
|
|
|
COPY --from=build /app/build/bin/llama-server /app/
|
|
COPY --from=build /app/lib/ /app/
|
|
|
|
ENV LC_ALL=C.utf8
|
|
# Must be set to 0.0.0.0 so it can listen to requests from host machine
|
|
ENV LLAMA_ARG_HOST=0.0.0.0
|
|
|
|
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
|
|
|
|
ENTRYPOINT [ "/app/llama-server" ]
|