2024-02-02 08:56:31 +01:00
|
|
|
ARG UBUNTU_VERSION=jammy
|
|
|
|
|
2024-07-17 20:21:55 +02:00
|
|
|
FROM ubuntu:$UBUNTU_VERSION AS build
|
2024-02-02 08:56:31 +01:00
|
|
|
|
|
|
|
# Install build tools
|
|
|
|
RUN apt update && apt install -y git build-essential cmake wget
|
|
|
|
|
2024-06-25 17:13:27 +02:00
|
|
|
# Install Vulkan SDK and cURL
|
2024-02-02 08:56:31 +01:00
|
|
|
RUN wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | apt-key add - && \
|
|
|
|
wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list && \
|
|
|
|
apt update -y && \
|
2024-06-25 17:13:27 +02:00
|
|
|
apt-get install -y vulkan-sdk libcurl4-openssl-dev curl
|
2024-04-04 18:31:22 +02:00
|
|
|
|
2024-02-02 08:56:31 +01:00
|
|
|
# Build it
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
2024-11-18 00:21:53 +01:00
|
|
|
RUN cmake -B build -DGGML_NATIVE=OFF -DGGML_VULKAN=1 -DLLAMA_CURL=1 && \
|
2024-06-13 01:41:52 +02:00
|
|
|
cmake --build build --config Release --target llama-server
|
2024-02-02 08:56:31 +01:00
|
|
|
|
|
|
|
# Clean up
|
|
|
|
WORKDIR /
|
2024-06-13 01:41:52 +02:00
|
|
|
RUN cp /app/build/bin/llama-server /llama-server && \
|
2024-02-02 08:56:31 +01:00
|
|
|
rm -rf /app
|
|
|
|
|
|
|
|
ENV LC_ALL=C.utf8
|
2024-08-27 11:07:01 +02: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-02-02 08:56:31 +01:00
|
|
|
|
2024-06-25 17:13:27 +02:00
|
|
|
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
|
|
|
|
|
2024-06-13 01:41:52 +02:00
|
|
|
ENTRYPOINT [ "/llama-server" ]
|