srivatsavdamaraju commited on
Commit
9378dee
·
verified ·
1 Parent(s): 50cb285

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -63
Dockerfile CHANGED
@@ -1,63 +1,18 @@
1
- # Use Ubuntu as base image
2
- FROM ubuntu:22.04
3
-
4
- # Set working directory
5
- WORKDIR /workspaces/empty
6
-
7
- # Update package list and install required dependencies
8
- RUN apt-get update && apt-get install -y \
9
- wget \
10
- unzip \
11
- curl \
12
- libgomp1 \
13
- libopenblas0 \
14
- libc6 \
15
- libgcc-s1 \
16
- libstdc++6 \
17
- && rm -rf /var/lib/apt/lists/*
18
-
19
- # Step 1: Download llama.cpp Precompiled Binary
20
- RUN wget https://github.com/ggml-org/llama.cpp/releases/download/b5452/llama-b5452-bin-ubuntu-x64.zip
21
-
22
- # Step 2: Unzip and examine contents
23
- RUN unzip llama-b5452-bin-ubuntu-x64.zip && ls -la
24
-
25
- # Step 3: Create build directory and move binaries
26
- RUN mkdir -p /workspaces/empty/build/bin && \
27
- if [ -d "llama-b5452-bin-ubuntu-x64" ]; then \
28
- mv llama-b5452-bin-ubuntu-x64/* /workspaces/empty/build/bin/; \
29
- rmdir llama-b5452-bin-ubuntu-x64; \
30
- else \
31
- find . -maxdepth 1 -name "*llama*" -type f -executable -exec mv {} /workspaces/empty/build/bin/ \; ; \
32
- fi
33
-
34
- # Make sure binaries are executable
35
- RUN chmod +x /workspaces/empty/build/bin/*
36
-
37
- # Create cache directory and set permissions
38
- RUN mkdir -p /.cache/llama.cpp && \
39
- chmod -R 777 /.cache
40
-
41
- # Create a non-root user for running the application
42
- RUN groupadd -r llama && useradd -r -g llama llama && \
43
- mkdir -p /home/llama/.cache/llama.cpp && \
44
- chown -R llama:llama /home/llama
45
-
46
- # Set environment variable for cache directory
47
- ENV XDG_CACHE_HOME=/home/llama/.cache
48
-
49
- # Switch to non-root user
50
- USER llama
51
-
52
- # Step 4 & 5: Set Environment Variables for PATH and LD_LIBRARY_PATH
53
- ENV PATH="/workspaces/empty/build/bin:${PATH}"
54
- ENV LD_LIBRARY_PATH="/workspaces/empty/build/bin:${LD_LIBRARY_PATH}"
55
-
56
- # Clean up downloaded zip file
57
- RUN rm -f llama-b5452-bin-ubuntu-x64.zip
58
-
59
- # Expose the default port for llama-server (usually 8080)
60
- EXPOSE 8080
61
-
62
- # Step 6: Set the default command to run llama-server
63
- CMD ["llama-server", "-hf", "ggml-org/SmolVLM-500M-Instruct-GGUF"]
 
1
+ FROM ubuntu:latest
2
+
3
+ RUN apt-get update && apt-get install -y git build-essential wget
4
+
5
+ WORKDIR /app
6
+
7
+ RUN git clone https://github.com/ggerganov/llama.cpp.git
8
+
9
+ WORKDIR /app/llama.cpp
10
+
11
+ RUN make
12
+
13
+ # Download model - replace with your model URL or local path
14
+ RUN wget -O models/7B/ggml-model-q4_0.bin https://huggingface.co/TheBloke/Llama-2-7B-GGML/resolve/main/llama-2-7b.ggmlv3.q4_0.bin
15
+
16
+ EXPOSE 8080
17
+
18
+ CMD ["./server", "--model", "models/7B/ggml-model-q4_0.bin", "--port", "8080", "--host", "0.0.0.0"]