File size: 1,528 Bytes
ffe6a6d
8005bfd
 
 
092894b
 
 
 
 
8005bfd
cd77221
 
8005bfd
c3be870
 
d15777d
c3be870
b6860db
d15777d
 
c3be870
 
 
 
a22d342
c3be870
 
cd77221
 
76d0080
8e70932
8005bfd
cd77221
8005bfd
6628f79
 
cd77221
092894b
 
8005bfd
5cd0fc3
 
092894b
76d0080
6628f79
 
8005bfd
cd77221
 
 
751d2b5
8005bfd
 
ec77d30
e76d839
b240da6
dc2112e
8733fdc
 
bb39212
b19af97
8005bfd
 
 
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM fedora:44

EXPOSE 7860

RUN dnf install python3.13 uv git-core sudo curl procps-ng ca-certificates -y \
    && useradd -m -u 1000 user \
    && mkdir -p /src /app/scripts /app/models \
    && chown -R user:user /src /app \
    && dnf clean all

# for the git checkout while we use git sources
# for the app

# install ollama, download model
RUN curl -fsSL https://ollama.com/install.sh | sh

ENV OLLAMA_HOST=0.0.0.0:11434
ENV OLLAMA_MODELS=/app/models

USER user
RUN ollama serve & \
    PID=$! && \
    sleep 5 && \
    ollama pull bge-m3 && \
    ollama pull llama-guard3:1b && \
    kill $PID

# set to invalidate cache
ARG CACHE_DATE=1
# currently off development
RUN git clone --branch=development --depth 1 https://github.com/NeuroML/klea.git /src

WORKDIR /src

RUN uv venv --python=/usr/bin/python3.13 /app/klea-venv
ENV VIRTUAL_ENV=/app/klea-venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV UV_LINK_MODE=hardlink
ENV UV_CACHE_DIR=/tmp/uv-cache

RUN pwd
RUN ls -lash
RUN uv pip install './utils_pkg[chroma,huggingface,nicegui,ollama]' './mcp_pkg' './rag_pkg[chroma,huggingface,nicegui,ollama]' && rm -rf /tmp/uv-cache
RUN ls -lash "$VIRTUAL_ENV/bin/"

RUN uv pip freeze

WORKDIR /app
USER user

COPY --chown=user scripts/* /app/scripts/
RUN chmod +x scripts/docker-deploy.sh

COPY --chown=user rag*.env /app
COPY --chown=user klea_rag*.json /app
COPY --chown=user store/ /app/store/

RUN ls -lash /app/*
RUN ls -lashR /app/store/

ENV KLEA_RAG_ENV_FILE=rag.env
ENV RUNNING_IN_DOCKER=1

CMD ["./scripts/docker-deploy.sh"]