OpenWebUI
目前最强大的AI前后端(但是也很吃性能)
services:
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
ports:
- "3000:8080"
volumes:
- open-webui:/app/backend/data
environment:
- STORAGE_PROVIDER=s3
- S3_ACCESS_KEY_ID=581c5b7e7304837ffa6b0c5410e869ed
- S3_BUCKET_NAME=web
- S3_ENDPOINT_URL=https://fccb494a4985b211afbfe26e87e1c7bc.r2.cloudflarestorage.com
- S3_KEY_PREFIX=openwebui
- S3_REGION_NAME=auto
- S3_SECRET_ACCESS_KEY=f40fe409cea27d970660a1abe1fcea06f701d56306adf347bfd26f0c0ed251e2
- DATABASE_URL=postgresql://openwebui_owner:npg_dStx0e3KNgEM@ep-late-snow-a192dz9a-pooler.ap-southeast-1.aws.neon.tech/openwebui?sslmode=require
- ENABLE_WEBSOCKET_SUPPORT=True
- WEBSOCKET_REDIS_URL=redis://redis:6379 # 修改为服务名 "redis"
- REDIS_URL=redis://redis:6379 # 修改为服务名 "redis"
- WEBUI_NAME=ChatWeb ST
- USER_AGENT=${USER_AGENT:-Mozilla/5.0 (compatible; OpenWebUI/1.0; +https://github.com/open-webui)}
build:
args:
USER_AGENT: $USER_AGENT
networks:
- openwebui # 指定自定义网络
depends_on:
- redis # 确保 Redis 先启动
redis: # 新增 Redis 服务
image: redis:latest
container_name: redis
networks:
- openwebui
watchtower:
image: containrrr/watchtower
container_name: open-webui-watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 3600 open-webui
depends_on:
- open-webui
networks:
- openwebui
networks:
openwebui: # 定义自定义网络
driver: bridge
volumes:
open-webui:PostgreSQL官网下载页:https://www.postgresql.org/download/
如果要安装别的版本的下方也有教程,不过还有一种方案是也在同一个docker网络中进行安装,示例如下:
然后就可以用DBeaver连接数据库了,连接后可以对数据库进行备份、恢复等操作

一些另外的附加事项:
超级进阶配置
数据库清理
一些脚本汇总
数据库清理脚本(仅适用于docker容器安装的数据库,直接进入docker,因此与端口无关):
本地备份脚本(备份到本地data数据盘/backup目录,并仅保留最近3天的备份):
数据库恢复脚本(需指定恢复文件,调整线程数):
备份文件迁移脚本:
最后更新于