aliroohan179 commited on
Commit
4eb2e2b
·
verified ·
1 Parent(s): 4b22690

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -20
Dockerfile CHANGED
@@ -1,38 +1,44 @@
1
  FROM ubuntu:22.04
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
 
4
 
5
- # Install dependencies
6
  RUN apt update && apt install -y \
7
  build-essential \
8
- cmake \
9
- git \
10
- git-lfs \
11
  curl \
12
- wget \
 
 
 
13
  python3 \
14
  python3-pip \
15
  libssl-dev \
16
- libcurl4-openssl-dev
 
 
 
 
 
 
 
 
17
 
18
- RUN git lfs install
 
19
 
20
- # Clone llama.cpp
21
- WORKDIR /app
22
- RUN git clone https://github.com/ggerganov/llama.cpp.git
23
- WORKDIR /app/llama.cpp
24
 
25
- # Checkout stable or latest release (optional)
26
- # RUN git checkout tags/brew-release-tag
27
 
28
- # Build with server support
29
- RUN mkdir build && cd build && \
30
- cmake .. -DLLAMA_SERVER=ON && \
31
- cmake --build . --config Release && \
32
- cp ./bin/server /usr/local/bin/llama-server
33
 
34
- # Expose the llama-server default port
35
  EXPOSE 8080
36
 
37
- # Now use the same command as your local machine
38
  CMD ["llama-server", "-hf", "ggml-org/SmolVLM-500M-Instruct-GGUF"]
 
1
  FROM ubuntu:22.04
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
+ ENV TZ=Etc/UTC
5
 
6
+ # Install dependencies for Homebrew and building llama.cpp
7
  RUN apt update && apt install -y \
8
  build-essential \
 
 
 
9
  curl \
10
+ file \
11
+ git \
12
+ sudo \
13
+ procps \
14
  python3 \
15
  python3-pip \
16
  libssl-dev \
17
+ libcurl4-openssl-dev \
18
+ ruby \
19
+ unzip \
20
+ ca-certificates \
21
+ gnupg \
22
+ software-properties-common
23
+
24
+ # Create a non-root user (Homebrew prefers not to run as root)
25
+ RUN useradd -m brewuser && echo "brewuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
26
 
27
+ USER brewuser
28
+ WORKDIR /home/brewuser
29
 
30
+ # Install Homebrew
31
+ RUN git clone https://github.com/Homebrew/brew ~/.linuxbrew/Homebrew && \
32
+ mkdir ~/.linuxbrew/bin && \
33
+ ln -s ~/.linuxbrew/Homebrew/bin/brew ~/.linuxbrew/bin/
34
 
35
+ ENV PATH="/home/brewuser/.linuxbrew/bin:/home/brewuser/.linuxbrew/sbin:$PATH"
 
36
 
37
+ # Install llama-cpp via Homebrew
38
+ RUN brew update && brew install llama-cpp
 
 
 
39
 
40
+ # Set port for llama-server
41
  EXPOSE 8080
42
 
43
+ # Run like on your machine
44
  CMD ["llama-server", "-hf", "ggml-org/SmolVLM-500M-Instruct-GGUF"]