ChandimaPrabath commited on
Commit
7ee6776
·
verified ·
1 Parent(s): bb40b07

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -8
Dockerfile CHANGED
@@ -1,21 +1,33 @@
 
1
  FROM ollama/ollama:latest
2
 
3
- RUN apt-get update && apt-get install curl -y
4
-
5
- # https://huggingface.co/docs/hub/spaces-sdks-docker-first-demo
6
- RUN useradd -m -u 1000 user
7
-
8
- USER user
9
 
 
10
  ENV HOME=/home/user \
11
- PATH=/home/user/.local/bin:$PATH \
12
  OLLAMA_HOST=0.0.0.0 \
13
  OLLAMA_ORIGINS=*
14
 
 
15
  WORKDIR $HOME/app
 
16
 
 
17
  COPY --chown=user:user Modelfile $HOME/app/
18
 
19
- RUN ollama serve & sleep 5 && ollama pull llama3.2 && ollama pull llama3.2:1b && ollama pull granite3-moe && ollama pull granite3-moe:1b
 
 
 
 
 
 
20
 
 
21
  EXPOSE 11434
 
1
+ # Use the latest version of the ollama image
2
  FROM ollama/ollama:latest
3
 
4
+ # Install curl and create a user
5
+ RUN apt-get update && \
6
+ apt-get install -y curl && \
7
+ apt-get clean && \
8
+ rm -rf /var/lib/apt/lists/* && \
9
+ useradd -m -u 1000 user
10
 
11
+ # Set environment variables
12
  ENV HOME=/home/user \
13
+ PATH=/home/user/.local/bin:$PATH \
14
  OLLAMA_HOST=0.0.0.0 \
15
  OLLAMA_ORIGINS=*
16
 
17
+ # Set the working directory and switch to the user
18
  WORKDIR $HOME/app
19
+ USER user
20
 
21
+ # Copy the Modelfile to the working directory
22
  COPY --chown=user:user Modelfile $HOME/app/
23
 
24
+ # Pull the necessary models and start the Ollama server
25
+ RUN ollama serve & \
26
+ sleep 5 && \
27
+ ollama pull llama3.2 && \
28
+ ollama pull llama3.2:1b && \
29
+ ollama pull granite3-moe && \
30
+ ollama pull granite3-moe:1b
31
 
32
+ # Expose the port for the Ollama server
33
  EXPOSE 11434