Open WebUI でウェブ検索したいから、SearXNG を導入する
前提
Ollama: ホストOSにインストール
これ以外のことにも使いたいので
Open WebUI, SearXNG: Docker でホスティング
Open WebUI の設定はこれをベースに、GPU 回りの設定を追加した 最初は雑に DuckDuckGo を使おうとしていたけれど、上手くいかない
たぶん後述のタイムアウトが発生している
ついでに DDG の検索精度はイマイチがちなので、他の検索エンジンも使いたい
まずは compose.yaml を良い感じにする
ポート番号の被りを避けるべく、こちらは 8888 でホストする
code:compose.yaml
name: open-webui-with-ollama
services:
open-webui:
container_name: open-webui
image: ghcr.io/open-webui/open-webui:ollama
restart: unless-stopped
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities:
- gpu
network_mode: host
volumes:
- open-webui:/app/backend/data
environment:
- ENABLE_WEB_SEARCH=true
- WEB_SEARCH_ENGINE=searxng
searxng:
container_name: searxng
image: searxng/searxng:latest
ports:
- "8888:8080"
volumes:
- ./searxng:/etc/searxng:rw
restart: unless-stopped
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
- DAC_OVERRIDE
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "1"
volumes:
open-webui:
external: true
name: open-webui
一度起動すると searxng/settings.yml が生成されるので、それを一部編集する
code: settings.yaml
# ~lines 60
# remove format to deny access, use lower case.
formats:
- html
- json
code: settings.yaml
outgoing:
# default timeout in seconds, can be override by engine
request_timeout: 10.0