zyxciss commited on
Commit
3e535f0
·
verified ·
1 Parent(s): 5ce1e07

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -3
Dockerfile CHANGED
@@ -1,9 +1,20 @@
1
  FROM ubuntu:22.04
2
 
 
3
  RUN apt update && apt install -y curl git python3 python3-pip
 
 
4
  RUN curl -fsSL https://ollama.com/install.sh | sh
5
 
6
- COPY start.sh /start.sh
7
- RUN chmod +x /start.sh
 
 
 
 
 
 
 
8
 
9
- CMD ["/start.sh"]
 
 
1
  FROM ubuntu:22.04
2
 
3
+ # Install dependencies
4
  RUN apt update && apt install -y curl git python3 python3-pip
5
+
6
+ # Install Ollama
7
  RUN curl -fsSL https://ollama.com/install.sh | sh
8
 
9
+ # Set Ollama's home and model directories to a writable location
10
+ ENV OLLAMA_HOME=/tmp/ollama
11
+ ENV OLLAMA_MODELS=/tmp/ollama/models
12
+
13
+ # Ensure the directory exists and is writable
14
+ RUN mkdir -p $OLLAMA_MODELS && chmod -R 777 /tmp/ollama
15
+
16
+ # Expose API port
17
+ EXPOSE 11434
18
 
19
+ # Start Ollama server
20
+ CMD ["bash", "-c", "export HOME=/tmp && export OLLAMA_HOME=/tmp/ollama && ollama serve"]