ChandimaPrabath commited on
Commit
b24dc4d
1 Parent(s): 37673ad

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -7
Dockerfile CHANGED
@@ -1,19 +1,30 @@
 
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
- USER user
8
  ENV HOME=/home/user \
9
- PATH=/home/user/.local/bin:$PATH \
10
  OLLAMA_HOST=0.0.0.0 \
11
  OLLAMA_ORIGINS=*
12
 
 
13
  WORKDIR $HOME/app
 
14
 
15
- COPY --chown=user:user Modelfile $HOME/app/
16
 
17
- RUN ollama serve & sleep 5 && ollama pull qwen2:0.5b
 
18
 
 
19
  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 --chown=user:user entrypoint.sh $HOME/app/
22
 
23
+ # Make the entrypoint script executable
24
+ RUN chmod +x $HOME/app/entrypoint.sh
25
 
26
+ # Expose the port for the Ollama server
27
  EXPOSE 11434
28
+
29
+ # Set the entrypoint to the entrypoint script
30
+ ENTRYPOINT ["./entrypoint.sh"]