Nielo47 commited on
Commit
81845d1
·
verified ·
1 Parent(s): 7f630eb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -10
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM python:3.10-slim
2
 
3
- # 1) System deps & Ollama installation
4
  RUN apt-get update \
5
  && apt-get install -y curl \
6
  && curl -fsSL https://ollama.com/install.sh | sh \
@@ -9,25 +9,23 @@ RUN apt-get update \
9
  # 2) Create non‑root user
10
  RUN useradd -m -u 1000 user
11
  USER user
12
- ENV HOME=/home/user \
13
- PATH="/home/user/.local/bin:$PATH"
14
 
15
- WORKDIR $HOME/app
16
-
17
- # 3) Install Python requirements
18
  COPY --chown=user:user requirements.txt .
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
- # 4) Pre‑pull Ollama models by briefly running the daemon in-build
22
  RUN ollama serve & \
23
  sleep 15 && \
24
- ollama pull nomic-embed-text && \ # ~274 MB download :contentReference[oaicite:0]{index=0}
25
- ollama pull gemma3:1b && \ # ~815 MB download :contentReference[oaicite:1]{index=1}
26
  pkill ollama
27
 
28
  # 5) Copy app sources & startup script
29
  COPY --chown=user:user . ./
30
  RUN chmod +x start.sh
31
 
32
- # 6) Launch entrypoint
33
  CMD ["./start.sh"]
 
1
  FROM python:3.10-slim
2
 
3
+ # 1) Install Ollama CLI
4
  RUN apt-get update \
5
  && apt-get install -y curl \
6
  && curl -fsSL https://ollama.com/install.sh | sh \
 
9
  # 2) Create non‑root user
10
  RUN useradd -m -u 1000 user
11
  USER user
12
+ ENV PATH="/home/user/.local/bin:$PATH"
13
+ WORKDIR /home/user/app
14
 
15
+ # 3) Install Python deps
 
 
16
  COPY --chown=user:user requirements.txt .
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
+ # 4) Pre‑pull models DURING BUILD
20
  RUN ollama serve & \
21
  sleep 15 && \
22
+ ollama pull nomic-embed-text && \
23
+ ollama pull gemma3:1b && \
24
  pkill ollama
25
 
26
  # 5) Copy app sources & startup script
27
  COPY --chown=user:user . ./
28
  RUN chmod +x start.sh
29
 
30
+ # 6) Launch
31
  CMD ["./start.sh"]