File size: 768 Bytes
a773709
746c218
a773709
c771c95
a773709
 
 
ce77e85
a773709
c771c95
2b26d8e
a773709
 
c771c95
 
a773709
c771c95
a773709
c771c95
a773709
 
 
ce77e85
c771c95
 
ea87279
 
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
28
FROM ollama/ollama

# 1. User & Permissions setup

RUN mkdir -p /home/user/.ollama
RUN chown -R 1000:1000 /home/user
ENV HOME=/home/user

# 2. Network Config

ENV OLLAMA_HOST=0.0.0.0:7860
ENV OLLAMA_ORIGINS=*

# 3. CRITICAL OPTIMIZATIONS for 2-3 Users
# Parallel: Allows 2 requests to run at the exact same time.
ENV OLLAMA_NUM_PARALLEL=2
# Keep Alive: Never unload the model from RAM (keeps it ready instantly).
ENV OLLAMA_KEEP_ALIVE=-1
# Max Models: Force Ollama to focus only on this one model to save RAM.
ENV OLLAMA_MAX_LOADED_MODELS=1
# 4. Switch to user
USER 1000
EXPOSE 7860
# 5. Start, optimize, and keep running
# We use 'qwen3:0.6b' (or the specific tag you need)
ENTRYPOINT ["/bin/sh", "-c", "ollama serve & sleep 10 && ollama pull qwen2.5:0.5b && wait"]