File size: 549 Bytes
57a1793
 
3e535f0
57a1793
3e535f0
 
57a1793
 
3e535f0
 
 
 
 
 
 
 
 
57a1793
3e535f0
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM ubuntu:22.04

# Install dependencies
RUN apt update && apt install -y curl git python3 python3-pip

# Install Ollama
RUN curl -fsSL https://ollama.com/install.sh | sh

# Set Ollama's home and model directories to a writable location
ENV OLLAMA_HOME=/tmp/ollama
ENV OLLAMA_MODELS=/tmp/ollama/models

# Ensure the directory exists and is writable
RUN mkdir -p $OLLAMA_MODELS && chmod -R 777 /tmp/ollama

# Expose API port
EXPOSE 11434

# Start Ollama server
CMD ["bash", "-c", "export HOME=/tmp && export OLLAMA_HOME=/tmp/ollama && ollama serve"]