diff --git a/public/templates/open-webui.png b/public/templates/open-webui.png new file mode 100644 index 00000000..2b207478 Binary files /dev/null and b/public/templates/open-webui.png differ diff --git a/templates/open-webui/docker-compose.yml b/templates/open-webui/docker-compose.yml new file mode 100644 index 00000000..005048ed --- /dev/null +++ b/templates/open-webui/docker-compose.yml @@ -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: {} diff --git a/templates/open-webui/index.ts b/templates/open-webui/index.ts new file mode 100644 index 00000000..9607285e --- /dev/null +++ b/templates/open-webui/index.ts @@ -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, + }; +} diff --git a/templates/templates.ts b/templates/templates.ts index a4b1a995..153b2ba5 100644 --- a/templates/templates.ts +++ b/templates/templates.ts @@ -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), + } ];