omkarshanbhag commited on
Commit
ccbc4b8
·
verified ·
1 Parent(s): faeab97

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -8
Dockerfile CHANGED
@@ -1,18 +1,15 @@
1
  # 1. Use the highly optimized C++ llama.cpp server
2
  FROM ghcr.io/ggerganov/llama.cpp:server
3
 
4
- # Switch to root temporarily to install missing packages
5
- USER root
6
- RUN apt-get update && apt-get install -y wget
7
-
8
  # 2. Expose the port Hugging Face expects for web traffic
9
  EXPOSE 7860
10
 
11
- # 3. Download the 4-bit quantized Gemma 2 (2B) model during the build phase
12
- RUN wget -O gemma-2b.gguf https://huggingface.co/bartowski/gemma-2-2b-it-GGUF/resolve/main/gemma-2-2b-it-Q4_K_M.gguf
 
13
 
14
- # Switch back to a non-root user (Hugging Face Spaces requires running as User 1000)
15
  USER 1000
16
 
17
  # 4. Boot the server
18
- CMD ["-m", "gemma-2b.gguf", "--host", "0.0.0.0", "--port", "7860", "-t", "2", "-c", "2048"]
 
1
  # 1. Use the highly optimized C++ llama.cpp server
2
  FROM ghcr.io/ggerganov/llama.cpp:server
3
 
 
 
 
 
4
  # 2. Expose the port Hugging Face expects for web traffic
5
  EXPOSE 7860
6
 
7
+ # 3. Download the model natively using Docker's ADD command.
8
+ # This bypasses the need for apt-get entirely and automatically assigns the correct permissions!
9
+ ADD --chown=1000:1000 https://huggingface.co/bartowski/gemma-2-2b-it-GGUF/resolve/main/gemma-2-2b-it-Q4_K_M.gguf /models/gemma-2b.gguf
10
 
11
+ # Switch to the non-root user required by Hugging Face Spaces
12
  USER 1000
13
 
14
  # 4. Boot the server
15
+ CMD ["-m", "/models/gemma-2b.gguf", "--host", "0.0.0.0", "--port", "7860", "-t", "2", "-c", "2048"]