llama-server-musa.Dockerfile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. ARG UBUNTU_VERSION=22.04
  2. # This needs to generally match the container host's environment.
  3. ARG MUSA_VERSION=rc3.1.0
  4. # Target the MUSA build image
  5. ARG BASE_MUSA_DEV_CONTAINER=mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
  6. # Target the MUSA runtime image
  7. ARG BASE_MUSA_RUN_CONTAINER=mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
  8. FROM ${BASE_MUSA_DEV_CONTAINER} AS build
  9. RUN apt-get update && \
  10. apt-get install -y build-essential git cmake libcurl4-openssl-dev
  11. WORKDIR /app
  12. COPY . .
  13. RUN cmake -B build -DGGML_MUSA=ON -DLLAMA_CURL=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
  14. cmake --build build --config Release --target llama-server -j$(nproc)
  15. FROM ${BASE_MUSA_RUN_CONTAINER} AS runtime
  16. RUN apt-get update && \
  17. apt-get install -y libcurl4-openssl-dev libgomp1 curl
  18. COPY --from=build /app/build/ggml/src/libggml.so /libggml.so
  19. COPY --from=build /app/build/src/libllama.so /libllama.so
  20. COPY --from=build /app/build/bin/llama-server /llama-server
  21. # Must be set to 0.0.0.0 so it can listen to requests from host machine
  22. ENV LLAMA_ARG_HOST=0.0.0.0
  23. HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
  24. ENTRYPOINT [ "/llama-server" ]