llama-server-cuda.Dockerfile 1020 Bytes
Newer Older
wangkx1's avatar
init  
wangkx1 committed
1
2
3
4
5
6
7
8
ARG UBUNTU_VERSION=22.04
# This needs to generally match the container host's environment.
ARG CUDA_VERSION=11.7.1
# Target the CUDA build image
ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
# Target the CUDA runtime image
ARG BASE_CUDA_RUN_CONTAINER=nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}

wangkx1's avatar
wangkx1 committed
9
FROM ${BASE_CUDA_DEV_CONTAINER} AS build
wangkx1's avatar
init  
wangkx1 committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23

# Unless otherwise specified, we make a fat build.
ARG CUDA_DOCKER_ARCH=all

RUN apt-get update && \
    apt-get install -y build-essential git libcurl4-openssl-dev

WORKDIR /app

COPY . .

# Set nvcc architecture
ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH}
# Enable CUDA
wangkx1's avatar
wangkx1 committed
24
ENV GGML_CUDA=1
wangkx1's avatar
init  
wangkx1 committed
25
26
27
28
29
# Enable cURL
ENV LLAMA_CURL=1

RUN make -j$(nproc) llama-server

wangkx1's avatar
wangkx1 committed
30
FROM ${BASE_CUDA_RUN_CONTAINER} AS runtime
wangkx1's avatar
init  
wangkx1 committed
31
32

RUN apt-get update && \
wangkx1's avatar
wangkx1 committed
33
    apt-get install -y libcurl4-openssl-dev libgomp1 curl
wangkx1's avatar
init  
wangkx1 committed
34
35
36

COPY --from=build /app/llama-server /llama-server

wangkx1's avatar
wangkx1 committed
37
38
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]

wangkx1's avatar
init  
wangkx1 committed
39
ENTRYPOINT [ "/llama-server" ]