File size: 437 Bytes
ad56392
 
ca77fc5
 
 
8b338c0
ca77fc5
 
ad56392
 
 
 
2e21ed6
f61aa95
 
 
 
 
ca77fc5
 
2e21ed6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM ollama/ollama:latest

# Create non-root user safely (no fixed UID to avoid conflicts)
RUN useradd -m appuser
USER appuser

ENV HOME=/home/appuser \
    PATH=/home/appuser/.local/bin:$PATH \
    OLLAMA_HOST=0.0.0.0

WORKDIR $HOME/app

# Preload the model at build time
RUN ollama serve & \
    sleep 5 && \
    ollama pull gpt-oss:20b && \
    pkill ollama

# Base image has ENTRYPOINT ["ollama"]
# Just pass arguments
CMD ["serve"]