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]' './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 RUNNING_IN_DOCKER=1 ENV KLEA_RAG_ENV_FILE=rag-hf.env CMD ["./scripts/docker-deploy.sh"]