Files
tobiichiGPT/docker-compose.yml
ChenKaiLiuG 13c8f8aa3c Add test.sh
2025-12-23 22:47:40 +08:00

92 lines
2.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: '3.8'
services:
# PostgreSQL - 共用資料庫(支援 pgvector
postgres:
image: pgvector/pgvector:pg15
container_name: tobiichiGPT-postgres
restart: unless-stopped
environment:
POSTGRES_DB: tobiichiGPT
POSTGRES_USER: tobiichi3227
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- /mnt/data/External/tobiichiGPT/db_data:/var/lib/postgresql/data
networks:
- tobiichiGPT-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tobiichi3227"]
interval: 10s
timeout: 5s
retries: 5
# API 轉接層 - 偽裝 OpenAI API
api:
image: python:3.11-slim
container_name: tobiichiGPT-api
restart: unless-stopped
ports:
- "18000:8000"
environment:
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=tobiichiGPT
- DB_USER=tobiichi3227
- DB_PASSWORD=${DB_PASSWORD}
- PAPERCUPS_URL=http://papercups:4000
- PAPERCUPS_API_TOKEN=${PAPERCUPS_API_TOKEN}
volumes:
- /mnt/data/External/tobiichiGPT/api_data:/app
working_dir: /app
command: >
sh -c "
pip install --no-cache-dir -r requirements.txt &&
python server.py
"
networks:
- tobiichiGPT-network
depends_on:
postgres:
condition: service_healthy
# Open WebUI - 用戶對話介面
openwebui:
image: ghcr.io/open-webui/open-webui:main
container_name: tobiichiGPT-ui
restart: unless-stopped
ports:
- "10060:8080"
environment:
- DATABASE_URL=postgresql://tobiichi3227:${DB_PASSWORD}@postgres:5432/tobiichiGPT
- WEBUI_AUTH=True
volumes:
- /mnt/data/External/tobiichiGPT/ui_data:/app/backend/data
networks:
- tobiichiGPT-network
depends_on:
postgres:
condition: service_healthy
# Papercups - 管理員對話介面
papercups:
image: papercups/papercups:latest
container_name: tobiichiGPT-papercups
restart: unless-stopped
ports:
- "14000:4000"
environment:
- DATABASE_URL=postgresql://tobiichi3227:${DB_PASSWORD}@postgres:5432/papercups
- SECRET_KEY_BASE=${PAPERCUPS_SECRET_KEY}
- BACKEND_URL=http://localhost:14000
- MIX_ENV=prod
networks:
- tobiichiGPT-network
depends_on:
postgres:
condition: service_healthy
networks:
tobiichiGPT-network:
driver: bridge
name: tobiichiGPT-network # 固定網路名稱,讓 proxy stack 可以連接