Skip to content

Commit

Permalink
Merge pull request #1277 from Websoft9/update-openwebui-a454f66f
Browse files Browse the repository at this point in the history
Update openwebui
  • Loading branch information
qiaofeng1227 authored Feb 5, 2025
2 parents 52271cc + 381c28e commit cee9a53
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 77 deletions.
52 changes: 12 additions & 40 deletions apps/openwebui/.env
Original file line number Diff line number Diff line change
@@ -1,47 +1,19 @@
W9_REPO=wordpress
W9_DIST=community
W9_VERSION=latest

W9_POWER_PASSWORD=1PrMxExC45LsCT

# Environments which for user settings when create application
# Named expression: W9_xxx_xxx_SET, xxx refer to file fields
W9_HTTP_PORT_SET=9001
# W9_HTTPS_PORT_SET=9002
# W9_DB_PORT_SET=3306
# W9_SSH_PORT_SET=23
W9_KEY_SET="dfsjdkjf77xjxcjcj"

#### -- Not allowed to edit below environments when recreate app based on existing data -- ####

W9_ID=openwebui

# W9_HTTP_PORT or W9_HTTPS_PORT is need at leaset and used for proxy for web application
# Some container (e.g teleport) need HTTPS access, then need to set this pra
W9_HTTP_PORT=80
W9_HTTPS_PORT=81

W9_LOGIN_USER=admin
# use https://1password.com/zh-cn/password-generator/ to genarate 14 bit password
# this password can also use password file
W9_LOGIN_PASSWORD=$W9_POWER_PASSWORD
W9_ADMIN_PATH="/wp-login"

# Container name's suffix must use one of the value
W9_DB_EXPOSE="mysql,postgresql,mariadb,mongodb,redis"

# It is used when the application APP needs to set an external URL, which can be IP(or domain), IP:PORT
# If have protocols, should be set it in the APP's ENV
W9_URL=internet_ip:$W9_HTTP_PORT_SET
# modifies W9_URL on init when it is true
W9_URL_REPLACE=true

W9_REPO=ghcr.io/open-webui/open-webui
W9_DIST='community'
W9_VERSION='main'
W9_POWER_PASSWORD='dx8!BEMBUxd6qHlU'

W9_HTTP_PORT=8080
W9_HTTP_PORT_SET='9001'
W9_ID='openwebui'
W9_URL='internet_ip:$W9_HTTP_PORT_SET'
W9_NETWORK=websoft9

#### ----------------------------------------------------------------------------------------- ####


# Below environment is created by apphub
# Below environment is created by this app: https://docs.openwebui.com/getting-started/env-configuration

#W9_NAME=""
#W9_RCODE=""
#W9_RCODE=""
OLLAMA_BASE_URL=http://$W9_ID-ollama:11434
22 changes: 21 additions & 1 deletion apps/openwebui/Notes.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
# Appname
# Open WebUI

## Guide

### Quick Start

1. Create administrator credential when Open WebUI setup
2. Go to the **Settings > Admin Settings** to add a LLM, e.g [tinydolphin](https://ollama.com/library/tinydolphin) which not exceeding 1GB
3. You can select **tinydolphin** for chat now

### Running with GPU?

1. Select version **cuda** when create this application
2. Edit this application with Compose and change `docker-compose-gpu.yml` to `docker-compose.yml`
3. Recreate this application

### Config

- Config Ollama URL: **设置 > 管理员设置**
- Mutiply Languages: Yes

## FAQ
45 changes: 45 additions & 0 deletions apps/openwebui/docker-compose-gpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# docs: https://docs.openwebui.com/getting-started/quick-start/

services:

app:
image: $W9_REPO:$W9_VERSION
container_name: $W9_ID
restart: unless-stopped
ports:
- $W9_HTTP_PORT_SET:8080
env_file: .env
volumes:
- open-webui:/app/backend/data
deploy:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]

ollama:
image: ollama/ollama
container_name: $W9_ID-ollama
restart: unless-stopped
deploy:
resources:
limits:
memory: 5g
cpus: '2'
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
volumes:
- ollama:/root/.ollama

volumes:
open-webui:
ollama:

networks:
default:
name: $W9_NETWORK
external: true
48 changes: 16 additions & 32 deletions apps/openwebui/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,34 @@
# image,docs: https://hub.docker.com/_/wordpress/
# docs: https://docs.openwebui.com/getting-started/quick-start/

services:

wordpress:
app:
image: $W9_REPO:$W9_VERSION
container_name: $W9_ID
restart: unless-stopped
#This is for access host from container
# extra_hosts: ["host.docker.internal:host-gateway"]
# command: |
# /bin/bash -c "ping -c 3 host.docker.internal"
logging:
driver: "json-file"
options:
max-file: "5"
max-size: 10m
deploy:
resources:
limits:
memory: 5g
cpus: '0.7'
ports:
- $W9_HTTP_PORT_SET:80
- $W9_HTTP_PORT_SET:8080
env_file: .env
volumes:
- wordpress:/var/www/html
- ./src/php_exra.ini:/usr/local/etc/php/conf.d/php_exra.ini
- open-webui:/app/backend/data

mariadb:
image: mariadb:10.4
container_name: $W9_ID-mariadb
ollama:
image: ollama/ollama
container_name: $W9_ID-ollama
restart: unless-stopped
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --innodb_log_buffer_size=30M
deploy:
resources:
limits:
memory: 5g
cpus: '2'
volumes:
- mysql_data:/var/lib/mysql
environment:
MYSQL_DATABASE: $W9_ID
MYSQL_USER: $W9_ID
MYSQL_PASSWORD: $W9_POWER_PASSWORD
MYSQL_ROOT_PASSWORD: $W9_POWER_PASSWORD
- ollama:/root/.ollama

volumes:
wordpress:
mysql_data:
open-webui:
ollama:

networks:
default:
name: $W9_NETWORK
external: true
external: true
6 changes: 2 additions & 4 deletions apps/openwebui/variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
"edition": [
{
"dist": "community",
"version": [
"latest"
]
"version": ["main","cuda"]
}
],
"requirements": {
"cpu": "2",
"memory": "4",
"disk": "1",
"disk": "10",
"url": "https://openwebui.com"
}
}

0 comments on commit cee9a53

Please sign in to comment.