Update Dockerfile
Browse files- Dockerfile +8 -10
Dockerfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
# 1)
|
| 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
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
| 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
|
| 22 |
RUN ollama serve & \
|
| 23 |
sleep 15 && \
|
| 24 |
-
ollama pull nomic-embed-text && \
|
| 25 |
-
ollama pull gemma3:1b && \
|
| 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
|
| 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"]
|