Files
docker-apps/open-webui-pro/docker-compose.yml
2026-01-18 09:05:55 +08:00

67 lines
1.7 KiB
YAML

services:
# --- 数据库服务 (PostgreSQL) ---
db:
image: postgres:15-alpine
container_name: open-webui-db
restart: unless-stopped
environment:
- POSTGRES_USER=webui_admin
- POSTGRES_PASSWORD=VURKxKYDmKw8u1CdS6RUf5LC
- POSTGRES_DB=openwebui
volumes:
- ./pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U webui_admin -d openwebui"]
interval: 5s
timeout: 5s
retries: 5
# --- 缓存服务 (Redis) ---
redis:
image: redis:7-alpine
container_name: open-webui-redis
restart: unless-stopped
volumes:
- ./redisdata:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 5s
timeout: 5s
retries: 5
# --- Open WebUI 主程序 ---
open-webui:
image: open-webui/open-webui:main
container_name: open-webui
restart: unless-stopped
ports:
- "3000:8080"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
# 数据库连接配置
- DATABASE_URL=postgresql://webui_admin:VURKxKYDmKw8u1CdS6RUf5LC@db:5432/openwebui
# Redis 连接配置
- REDIS_URL=redis://redis:6379/0
# Ollama 接口地址 (根据实际情况调整)
- OLLAMA_BASE_URL=http://host.docker.internal:11434
# 安全密钥
- WEBUI_SECRET_KEY=HU13YdOhfTaINvCe1PvjlhW0yHVaiaBBqsCtXCWFDAKD44zp
volumes:
- ./data:/app/backend/data
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
# 也可以使用上述 ./data 这种本地路径形式,更加直观
pgdata:
redisdata:
data:
networks:
webui-network:
external: true