Update Dockerfile
Browse files- 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 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
-
|
|
|
|
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"]
|