thewise commited on
Commit
360362a
1 Parent(s): c9e8946

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -19
Dockerfile CHANGED
@@ -1,26 +1,20 @@
1
- FROM ollama/ollama AS base
 
2
 
3
- # Create the /.ollama directory and ensure it has the right permissions
4
- USER root
5
- RUN mkdir -p /.ollama && \
6
- chmod -R 777 /.ollama
7
 
8
- # Copy your scripts and set them up
9
- COPY ollama-pull.sh /ollama-pull.sh
10
- RUN chmod +x /ollama-pull.sh
11
 
12
- # Switch to your application's user if it doesn't require root
13
- # USER appuser
14
 
15
- ENV model="llama2"
16
 
17
- # Run your script as the last step of the build process
18
- RUN /ollama-pull.sh
19
 
20
- FROM base AS final-stage
 
21
 
22
- # Setup entrypoint and default command
23
- ENTRYPOINT ["/bin/ollama"]
24
- EXPOSE 11434
25
- ENV OLLAMA_HOST 0.0.0.0
26
- CMD ["serve"]
 
1
+ # Builder stage
2
+ FROM ubuntu:latest
3
 
4
+ RUN apt update && apt install curl -y
 
 
 
5
 
6
+ RUN curl https://ollama.ai/install.sh | sh
 
 
7
 
8
+ # Create the directory and give appropriate permissions
9
+ RUN mkdir -p /.ollama && chmod 777 /.ollama
10
 
11
+ WORKDIR /.ollama
12
 
13
+ # Command to run the application
14
+ CMD ollama serve
15
 
16
+ # Command to pull model
17
+ CMD ollama pull llama2
18
 
19
+ # Expose the server port
20
+ EXPOSE 7860