feat(open-webui): add open-webui template

This commit is contained in:
Andrey Kucherenko 2024-07-03 18:21:01 +03:00
parent 4d251271b9
commit 152a54b251
4 changed files with 75 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,39 @@
version: '3.8'
services:
ollama:
volumes:
- ollama:/root/.ollama
container_name: ollama
networks:
- dokploy-network
pull_policy: always
tty: true
restart: unless-stopped
image: ollama/ollama:${OLLAMA_DOCKER_TAG-latest}
open-webui:
image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG-main}
container_name: open-webui
networks:
- dokploy-network
volumes:
- open-webui:/app/backend/data
depends_on:
- ollama
environment:
- 'OLLAMA_BASE_URL=http://ollama:11434'
- 'WEBUI_SECRET_KEY='
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.${HASH}.rule=Host(`${OPEN_WEBUI_HOST}`)"
- "traefik.http.services.${HASH}.loadbalancer.server.port=${OPEN_WEBUI_PORT}"
networks:
dokploy-network:
external: true
volumes:
ollama: {}
open-webui: {}

View File

@ -0,0 +1,22 @@
import {
generateHash,
generateRandomDomain,
type Template,
type Schema,
} from "../utils";
export function generate(schema: Schema): Template {
const mainServiceHash = generateHash(schema.projectName);
const randomDomain = generateRandomDomain(schema);
const envs = [
`OPEN_WEBUI_HOST=${randomDomain}`,
"OPEN_WEBUI_PORT=8080",
`HASH=${mainServiceHash}`,
'OLLAMA_DOCKER_TAG=latest',
'WEBUI_DOCKER_TAG=main'
];
return {
envs,
};
}

View File

@ -318,4 +318,18 @@ export const templates: TemplateData[] = [
tags: ["hosting"],
load: () => import("./glitchtip/index").then((m) => m.generate),
},
{
id: 'open-webui',
name: 'Open WebUI',
version: 'latest',
description: 'Open WebUI is a free and open source chatgpt alternative. Open WebUI is an extensible, feature-rich, and user-friendly self-hosted WebUI designed to operate entirely offline. It supports various LLM runners, including Ollama and OpenAI-compatible APIs. The template include ollama and webui services.',
logo: 'open-webui.png',
links: {
github: 'https://github.com/open-webui/open-webui',
website: 'https://openwebui.com/',
docs: 'https://docs.openwebui.com/',
},
tags: ['chat'],
load: () => import('./open-webui/index').then((m) => m.generate),
}
];