File size: 714 Bytes
46c9e6f
327e4b4
eccb1d3
46c9e6f
327e4b4
1808f99
46c9e6f
327e4b4
1808f99
 
 
 
 
e6e432a
1808f99
 
 
d065d39
1808f99
 
 
 
 
 
 
eccb1d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM ollama/ollama:latest

# Expose your desired port
EXPOSE 7860

# Configure Ollama to listen on all interfaces at port 7860
ENV OLLAMA_HOST=0.0.0.0:7860

# Set environment to disable caching and history
ENV OLLAMA_NOHISTORY=true
ENV OLLAMA_MULTIUSER_CACHE=false
ENV OLLAMA_NOPRUNE=true
ENV OLLAMA_MODELS=/tmp/.ollama/models

# Create a temporary models directory in memory (optional: may require tmpfs mounting)
RUN mkdir -p /tmp/.ollama/models && \
    chmod -R 777 /tmp/.ollama/models

# Use RAM-based directory (if Docker supports tmpfs)
VOLUME ["/tmp/.ollama/models"]

# Prevent model/key persistence
RUN rm -rf /.ollama && mkdir -p /.ollama && chmod -R 777 /.ollama

# Final command to serve
CMD ["serve"]