FROM fedora:44 EXPOSE 7860 RUN dnf install python3.13 uv git-core sudo curl procps-ng ca-certificates -y && dnf clean all RUN useradd -m -u 1000 user # for the git checkout while we use git sources RUN mkdir -p /src && chown -R user:user /src # for the app RUN mkdir -p /app/scripts && chown -R user:user /app RUN mkdir -p /app/models && chown -R user:user /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 RUN chown -R user:user /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=copy RUN pwd RUN ls -lash RUN --mount=type=cache,target=/home/user/.cache/uv,uid=1000,gid=1000 uv pip install './utils_pkg[chroma,huggingface,nicegui,ollama]' './mcp_pkg' './rag_pkg[chroma,huggingface,nicegui,ollama]' 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"]