Xlnk commited on
Commit
89b549f
·
verified ·
1 Parent(s): fd21230

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -0
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+ WORKDIR /app
5
+
6
+ # Install dependencies
7
+ RUN apt update && apt install -y \
8
+ git \
9
+ cmake \
10
+ build-essential \
11
+ curl \
12
+ ca-certificates \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Clone llama.cpp
16
+ RUN git clone https://github.com/ggerganov/llama.cpp
17
+
18
+ # Build llama-server
19
+ RUN cmake -S llama.cpp -B llama.cpp/build \
20
+ -DLLAMA_BUILD_SERVER=ON \
21
+ -DCMAKE_BUILD_TYPE=Release \
22
+ && cmake --build llama.cpp/build --target llama-server -j$(nproc)
23
+
24
+ # Create model directory
25
+ RUN mkdir -p /models
26
+
27
+ # Download a GGUF model (example: Qwen 0.5B)
28
+ RUN curl -L -o /models/model.gguf \
29
+ https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF/resolve/main/qwen2.5-0.5b-instruct-q4_k_m.gguf
30
+
31
+ # Copy start script
32
+ COPY start.sh /start.sh
33
+ RUN chmod +x /start.sh
34
+
35
+ EXPOSE 7860
36
+
37
+ CMD ["/start.sh"]