|
FROM python:3.10-slim |
|
|
|
|
|
RUN apt-get update \ |
|
&& apt-get install -y curl procps \ |
|
&& curl -fsSL https://ollama.com/install.sh | sh \ |
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
USER user |
|
ENV PATH="/home/user/.local/bin:$PATH" |
|
WORKDIR /home/user/app |
|
|
|
|
|
COPY --chown=user:user requirements.txt . |
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
RUN ollama serve & \ |
|
sleep 15 && \ |
|
ollama pull nomic-embed-text && \ |
|
ollama pull gemma3:1b && \ |
|
pkill ollama |
|
|
|
|
|
COPY --chown=user:user . ./ |
|
RUN chmod +x start.sh |
|
|
|
|
|
CMD ["./start.sh"] |
|
|