Nielo47 commited on
Commit
4b2ead1
·
verified ·
1 Parent(s): 81845d1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -6
Dockerfile CHANGED
@@ -1,8 +1,8 @@
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 \
7
  && apt-get clean && rm -rf /var/lib/apt/lists/*
8
 
@@ -12,20 +12,20 @@ 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"]
 
1
  FROM python:3.10-slim
2
 
3
+ # 1) Install curl, Ollama CLI, and procps (for pkill/killall)
4
  RUN apt-get update \
5
+ && apt-get install -y curl procps \
6
  && curl -fsSL https://ollama.com/install.sh | sh \
7
  && apt-get clean && rm -rf /var/lib/apt/lists/*
8
 
 
12
  ENV PATH="/home/user/.local/bin:$PATH"
13
  WORKDIR /home/user/app
14
 
15
+ # 3) Install Python dependencies
16
  COPY --chown=user:user requirements.txt .
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
+ # 4) Pre‑pull Ollama 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 application code and startup script
27
  COPY --chown=user:user . ./
28
  RUN chmod +x start.sh
29
 
30
+ # 6) Default command
31
  CMD ["./start.sh"]