muryshev commited on
Commit
de5bd55
·
verified ·
1 Parent(s): f04355c

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +46 -0
Dockerfile ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ARG UBUNTU_VERSION=22.04
2
+ ARG CUDA_VERSION=12.3.1
3
+ ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
4
+ ARG BASE_CUDA_RUN_CONTAINER=nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
5
+
6
+ FROM ${BASE_CUDA_DEV_CONTAINER} as build
7
+
8
+ ARG CUDA_DOCKER_ARCH=all
9
+
10
+ RUN apt-get update --fix-missing && \
11
+ apt-get install -y --no-install-recommends git build-essential gcc cmake && \
12
+ rm -rf /var/lib/apt/lists/*
13
+
14
+ WORKDIR /build
15
+
16
+ RUN git clone https://github.com/ggerganov/llama.cpp.git
17
+
18
+ WORKDIR /build/llama.cpp
19
+
20
+ ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH}
21
+ ENV LLAMA_CUBLAS=1
22
+
23
+ RUN mkdir build && \
24
+ cd build && \
25
+ cmake .. -DLLAMA_CUBLAS=ON && \
26
+ cmake --build . --config Release
27
+
28
+ FROM ${BASE_CUDA_RUN_CONTAINER} as runtime
29
+ RUN apt-get update --fix-missing && \
30
+ apt-get install -y --no-install-recommends wget && \
31
+ rm -rf /var/lib/apt/lists/*
32
+
33
+ WORKDIR /app
34
+
35
+ # Copy the executable from the build stage
36
+ COPY --from=build /build/llama.cpp/build/bin/server /app
37
+ COPY --from=build /build/llama.cpp/examples/server/public /app/public
38
+ COPY ./run.sh /app/run.sh
39
+ WORKDIR /app
40
+ EXPOSE 7867
41
+
42
+ # Make the script executable
43
+ RUN chmod +x run.sh
44
+
45
+ # CMD to run your script
46
+ CMD ./run.sh