File size: 518 Bytes
125b07b
 
 
 
 
 
 
2d07114
125b07b
 
 
2d07114
125b07b
2d07114
 
125b07b
 
2d07114
 
 
 
 
125b07b
 
 
2d07114
125b07b
2d07114
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 python:3.11-slim

RUN apt-get update && apt-get install -y \
    curl \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir gradio requests

RUN useradd -m -u 1000 user

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

USER user
ENV HOME=/home/user
WORKDIR $HOME/app

ENV OLLAMA_HOST=0.0.0.0
ENV OLLAMA_MODELS=$HOME/.ollama/models

COPY --chown=user:user app.py .
COPY --chown=user:user entrypoint.sh .

RUN chmod +x entrypoint.sh

EXPOSE 7860

CMD ["bash", "entrypoint.sh"]