From 00f92b8cf6f021b3f91318fc78a58d9a97018e0e Mon Sep 17 00:00:00 2001 From: Thomas Mecattaf <105132455+mecattaf@users.noreply.github.com> Date: Fri, 3 May 2024 16:28:22 -0400 Subject: [PATCH] Create Containerfile.ollama First draft of an Ollama Toolbox for ublue as per https://github.com/ublue-os/boxkit/issues/72 --- toolboxes/ollama-toolbox/Containerfile.ollama | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 toolboxes/ollama-toolbox/Containerfile.ollama diff --git a/toolboxes/ollama-toolbox/Containerfile.ollama b/toolboxes/ollama-toolbox/Containerfile.ollama new file mode 100644 index 0000000..f4514aa --- /dev/null +++ b/toolboxes/ollama-toolbox/Containerfile.ollama @@ -0,0 +1,29 @@ +# Use the customized bluefin-cli as the base image +ARG SOURCE_IMAGE_NAME="${SOURCE_IMAGE_NAME:-wolfi-toolbox}" +ARG SOURCE_IMAGE_REGISTRY="${SOURCE_IMAGE_REGISTRY:-ghcr.io/ublue-os}" +ARG SOURCE_IMAGE="${SOURCE_IMAGE_REGISTRY}/${SOURCE_IMAGE_NAME}" + +FROM $SOURCE_IMAGE:latest + +# Metadata +LABEL description="A container image with integrated Ollama and OpenWebUI for development environments." + +# Install Homebrew packages (assuming the base image is set up for Homebrew) +RUN brew install gum && \ + brew install ollama + +# Setup Ollama environment +RUN mkdir -p /opt/ollama + +# Pull the OpenWebUI container image and configure it +RUN podman pull ghcr.io/open-webui/open-webui:latest && \ + podman create --name ollama-web -e OLLAMA_BASE_URL=http://localhost:11434 \ + -e WEBUI_SECRET_KEY=abc123 -e DEFAULT_USER_ROLE=admin -e ENABLE_SIGNUP=true \ + -p 8080:8080 ghcr.io/open-webui/open-webui:latest + +# Expose ports for Ollama and OpenWebUI +EXPOSE 11434 8080 + +# Configure entrypoint and command to keep the container running and services operational +ENTRYPOINT ["podman", "systemd", "--user"] +CMD ["--keep-running"]