2024-01-28 07:55:31 +00:00
|
|
|
ARG UBUNTU_VERSION=22.04
|
|
|
|
|
2024-07-17 18:21:55 +00:00
|
|
|
FROM ubuntu:$UBUNTU_VERSION AS build
|
2024-01-28 07:55:31 +00:00
|
|
|
|
|
|
|
RUN apt-get update && \
|
2024-12-01 15:12:41 +00:00
|
|
|
apt-get install -y build-essential git cmake libcurl4-openssl-dev
|
2024-01-28 07:55:31 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2024-12-04 13:45:40 +00:00
|
|
|
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) && \
|
2024-12-01 15:12:41 +00:00
|
|
|
mkdir -p /app/lib && \
|
|
|
|
find build -name "*.so" -exec cp {} /app/lib/ \;
|
2024-01-28 07:55:31 +00:00
|
|
|
|
2024-07-17 18:21:55 +00:00
|
|
|
FROM ubuntu:$UBUNTU_VERSION AS runtime
|
2024-01-28 07:55:31 +00:00
|
|
|
|
2024-12-04 13:45:40 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
2024-04-03 17:56:37 +00:00
|
|
|
RUN apt-get update && \
|
2024-08-04 18:17:16 +00:00
|
|
|
apt-get install -y libcurl4-openssl-dev libgomp1 curl
|
2024-04-03 17:56:37 +00:00
|
|
|
|
2024-12-04 13:45:40 +00:00
|
|
|
COPY --from=build /app/build/bin/llama-server /app/
|
|
|
|
COPY --from=build /app/lib/ /app/
|
2024-01-28 07:55:31 +00:00
|
|
|
|
|
|
|
ENV LC_ALL=C.utf8
|
2024-08-27 09:07:01 +00:00
|
|
|
# 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
|
2024-01-28 07:55:31 +00:00
|
|
|
|
2024-06-25 15:13:27 +00:00
|
|
|
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
|
|
|
|
|
2024-12-04 13:45:40 +00:00
|
|
|
ENTRYPOINT [ "/app/llama-server" ]
|