name:Create and publish Docker images with specific build args
name:Create and publish a Docker image
# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
on:
workflow_dispatch:
push:
push:
branches:
branches:
-main
-main
...
@@ -10,30 +9,39 @@ on:
...
@@ -10,30 +9,39 @@ on:
tags:
tags:
-v*
-v*
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
env:
REGISTRY:ghcr.io
REGISTRY:ghcr.io
IMAGE_NAME:${{ github.repository }}
IMAGE_NAME:${{ github.repository }}
FULL_IMAGE_NAME:ghcr.io/${{ github.repository }}
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
jobs:
build-and-push-image:
build-main-image:
runs-on:ubuntu-latest
runs-on:ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
-name:Log in to the Container registry
-name:Log in to the Container registry
uses:docker/login-action@v3
uses:docker/login-action@v3
with:
with:
...
@@ -41,12 +49,11 @@ jobs:
...
@@ -41,12 +49,11 @@ jobs:
username:${{ github.actor }}
username:${{ github.actor }}
password:${{ secrets.GITHUB_TOKEN }}
password:${{ secrets.GITHUB_TOKEN }}
-name:Extract metadata for Docker images
-name:Extract metadata for Docker images (default latest tag)
id:meta
id:meta
uses:docker/metadata-action@v5
uses:docker/metadata-action@v5
with:
with:
images:${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images:${{ env.FULL_IMAGE_NAME }}
# This configuration dynamically generates tags based on the branch, tag, commit, and custom suffix for lite version.
# for better performance and multilangauge support use "intfloat/multilingual-e5-large" (~2.5GB) or "intfloat/multilingual-e5-base" (~1.5GB)
# IMPORTANT: If you change the default model (all-MiniLM-L6-v2) and vice versa, you aren't able to use RAG Chat with your previous documents loaded in the WebUI! You need to re-embed them.
ARG USE_EMBEDDING_MODEL=all-MiniLM-L6-v2
FROM node:alpine as build
######## WebUI frontend ########
FROM --platform=$BUILDPLATFORM node:21-alpine3.19 as build
WORKDIR /app
WORKDIR /app
# wget embedding model weight from alpine (does not exist from slim-buster)
RUN wget "https://chroma-onnx-models.s3.amazonaws.com/all-MiniLM-L6-v2/onnx.tar.gz"-O - | \
tar-xzf - -C /app
COPY package.json package-lock.json ./
COPY package.json package-lock.json ./
RUN npm ci
RUN npm ci
COPY . .
COPY . .
RUN npm run build
RUN npm run build
######## WebUI backend ########
FROM python:3.11-slim-bookworm as base
FROM python:3.11-slim-bookworm as base
ENV ENV=prod
# Use args
ENV PORT ""
ARG USE_CUDA
ARG USE_OLLAMA
ENV OLLAMA_BASE_URL "/ollama"
ARG USE_CUDA_VER
ARG USE_EMBEDDING_MODEL
ENV OPENAI_API_BASE_URL ""
ENV OPENAI_API_KEY ""
## Basis ##
ENV ENV=prod \
ENV WEBUI_SECRET_KEY ""
PORT=8080 \
ENV WEBUI_AUTH_TRUSTED_EMAIL_HEADER ""
# pass build args to the build
USE_OLLAMA_DOCKER=${USE_OLLAMA} \
ENV SCARF_NO_ANALYTICS true
USE_CUDA_DOCKER=${USE_CUDA} \
ENV DO_NOT_TRACK true
USE_CUDA_DOCKER_VER=${USE_CUDA_VER} \
USE_EMBEDDING_MODEL_DOCKER=${USE_EMBEDDING_MODEL}
## Basis URL Config ##
ENV OLLAMA_BASE_URL="/ollama" \
OPENAI_API_BASE_URL=""
## API Key and Security Config ##
ENV OPENAI_API_KEY="" \
WEBUI_SECRET_KEY="" \
SCARF_NO_ANALYTICS=true \
DO_NOT_TRACK=true
# Use locally bundled version of the LiteLLM cost map json
# Use locally bundled version of the LiteLLM cost map json
# IMPORTANT: If you change the default model (all-MiniLM-L6-v2) and vice versa, you aren't able to use RAG Chat with your previous documents loaded in the WebUI! You need to re-embed them.
ENV RAG_EMBEDDING_MODEL="all-MiniLM-L6-v2"
# device type for whisper tts and embbeding models - "cpu" (default), "cuda" (nvidia gpu and CUDA required) or "mps" (apple silicon) - choosing this right can lead to better performance
> When using Docker to install Open WebUI, make sure to include the `-v open-webui:/app/backend/data` in your Docker command. This step is crucial as it ensures your database is properly mounted and prevents any loss of data.
> When using Docker to install Open WebUI, make sure to include the `-v open-webui:/app/backend/data` in your Docker command. This step is crucial as it ensures your database is properly mounted and prevents any loss of data.
-**If Ollama is on your computer**, use this command:
> [!TIP]
> If you wish to utilize Open WebUI with Ollama included or CUDA acceleration, we recommend utilizing our official images tagged with either `:cuda` or `:ollama`. To enable CUDA, you must install the [Nvidia CUDA container toolkit](https://docs.nvidia.com/dgx/nvidia-container-runtime-upgrade/) on your Linux/WSL system.
```bash
**If Ollama is on your computer**, use this command:
@@ -391,10 +402,22 @@ if WEBUI_AUTH and WEBUI_SECRET_KEY == "":
...
@@ -391,10 +402,22 @@ if WEBUI_AUTH and WEBUI_SECRET_KEY == "":
CHROMA_DATA_PATH=f"{DATA_DIR}/vector_db"
CHROMA_DATA_PATH=f"{DATA_DIR}/vector_db"
# this uses the model defined in the Dockerfile ENV variable. If you dont use docker or docker based deployments such as k8s, the default embedding model will be used (all-MiniLM-L6-v2)
# this uses the model defined in the Dockerfile ENV variable. If you dont use docker or docker based deployments such as k8s, the default embedding model will be used (all-MiniLM-L6-v2)
# device type ebbeding models - "cpu" (default), "cuda" (nvidia gpu required) or "mps" (apple silicon) - choosing this right can lead to better performance
log.info(f"Embedding model set: {RAG_EMBEDDING_MODEL}"),
# device type ebbeding models - "cpu" (default), "cuda" (nvidia gpu required) or "mps" (apple silicon) - choosing this right can lead to better performance