File size: 492 Bytes
bda7d92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM python:3.11-slim

RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://ollama.com/install.sh | sh

RUN useradd -m -u 1000 user
WORKDIR /app
ENV OLLAMA_MODELS=/data/models
ENV OLLAMA_HOST=0.0.0.0

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .
RUN chown -R user:user /app
USER user

EXPOSE 7860
CMD ["sh", "-c", "ollama serve & sleep 5 && ollama pull qwen2.5-coder:7b-instruct-q4_K_M && python app.py"]