barisaydin commited on
Commit
dfa7701
1 Parent(s): 562e013

Add Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the latest Ubuntu image as the base
2
+ FROM ubuntu:latest
3
+
4
+ # Update the package list, install curl, and clean up to reduce image size
5
+ RUN apt-get update && \
6
+ apt-get install -y curl && \
7
+ apt-get clean && \
8
+ rm -rf /var/lib/apt/lists/*
9
+
10
+ # Install Ollama using the official install script
11
+ RUN curl -fsSL https://ollama.com/install.sh | sh
12
+
13
+ # Set the Ollama host environment variable
14
+ ENV OLLAMA_HOST=0.0.0.0
15
+
16
+ # Create the Ollama directory and set permissions
17
+ RUN mkdir -p /.ollama && chmod 777 /.ollama
18
+
19
+ # Create the models directory and set permissions
20
+ RUN mkdir -p /usr/share/ollama/.ollama/models && chmod -R 777 /usr/share/ollama/.ollama/models
21
+
22
+ # Set the Ollama models environment variable
23
+ ENV OLLAMA_MODELS="/usr/share/ollama/.ollama/models"
24
+
25
+ # Expose the Ollama server port
26
+ EXPOSE 7860
27
+
28
+ # Run the Ollama server and pull the model
29
+ CMD ollama serve & sleep 5 && ollama pull llama3 && ollama pull llava-llama3 && wait
30
+ # CMD ollama serve & sleep 5 && ollama pull llama3:70b && wait