- 修复MCP Server数据库连接和导入问题 - 创建Data Ingestion服务核心模块 - 配置阿里云镜像源提升构建速度 - 添加项目状态报告和文档 - 完善微服务架构基础设施
249 lines
5.9 KiB
YAML
249 lines
5.9 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# 数据库服务
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: taiji-postgres
|
|
environment:
|
|
POSTGRES_DB: taiji_db
|
|
POSTGRES_USER: taiji_user
|
|
POSTGRES_PASSWORD: taiji_pass
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./scripts/init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
ports:
|
|
- "5432:5432"
|
|
networks:
|
|
- taiji-network
|
|
restart: unless-stopped
|
|
|
|
# Redis缓存服务
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: taiji-redis
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis_data:/data
|
|
networks:
|
|
- taiji-network
|
|
restart: unless-stopped
|
|
|
|
# NATS消息队列
|
|
nats:
|
|
image: nats:2.10-alpine
|
|
container_name: taiji-nats
|
|
ports:
|
|
- "4222:4222" # Client connections
|
|
- "6222:6222" # Routing
|
|
- "8222:8222" # Monitoring
|
|
command: ["-js", "-m", "8222"] # Enable JetStream and monitoring
|
|
volumes:
|
|
- nats_data:/data
|
|
networks:
|
|
- taiji-network
|
|
restart: unless-stopped
|
|
|
|
# LiteLLM网关服务
|
|
litellm-gateway:
|
|
build:
|
|
context: ./services/model-gateway
|
|
dockerfile: Dockerfile
|
|
container_name: taiji-litellm-gateway
|
|
ports:
|
|
- "4000:4000"
|
|
environment:
|
|
- LITELLM_MASTER_KEY=sk-taiji-master-key
|
|
- DATABASE_URL=postgresql://taiji_user:taiji_pass@postgres:5432/taiji_db
|
|
- REDIS_URL=redis://redis:6379
|
|
volumes:
|
|
- ./services/model-gateway/config:/app/config
|
|
- ./logs:/app/logs
|
|
depends_on:
|
|
- postgres
|
|
- redis
|
|
networks:
|
|
- taiji-network
|
|
restart: unless-stopped
|
|
|
|
# 数据接入服务 (Python)
|
|
data-ingestion:
|
|
build:
|
|
context: ./services/data-ingestion
|
|
dockerfile: Dockerfile
|
|
container_name: taiji-data-ingestion
|
|
ports:
|
|
- "8001:8000"
|
|
environment:
|
|
- DATABASE_URL=postgresql://taiji_user:taiji_pass@postgres:5432/taiji_db
|
|
- REDIS_URL=redis://redis:6379
|
|
- NATS_URL=nats://nats:4222
|
|
volumes:
|
|
- ./services/data-ingestion:/app
|
|
- ./logs:/app/logs
|
|
depends_on:
|
|
- postgres
|
|
- redis
|
|
- nats
|
|
networks:
|
|
- taiji-network
|
|
restart: unless-stopped
|
|
|
|
# MCP服务器 (Python)
|
|
mcp-server:
|
|
build:
|
|
context: ./services/mcp-server
|
|
dockerfile: Dockerfile
|
|
container_name: taiji-mcp-server
|
|
ports:
|
|
- "8002:8000"
|
|
environment:
|
|
- DATABASE_URL=postgresql://taiji_user:taiji_pass@postgres:5432/taiji_db
|
|
- REDIS_URL=redis://redis:6379
|
|
- NATS_URL=nats://nats:4222
|
|
- LITELLM_URL=http://litellm-gateway:4000
|
|
volumes:
|
|
- ./services/mcp-server:/app
|
|
- ./logs:/app/logs
|
|
depends_on:
|
|
- postgres
|
|
- redis
|
|
- nats
|
|
- litellm-gateway
|
|
networks:
|
|
- taiji-network
|
|
restart: unless-stopped
|
|
|
|
# Agent注册中心 (Go) - 暂时禁用
|
|
# agent-registry:
|
|
# build:
|
|
# context: ./services/agent-registry
|
|
# dockerfile: Dockerfile
|
|
# container_name: taiji-agent-registry
|
|
# ports:
|
|
# - "8003:8080"
|
|
# environment:
|
|
# - DATABASE_URL=postgresql://taiji_user:taiji_pass@postgres:5432/taiji_db
|
|
# - REDIS_URL=redis://redis:6379
|
|
# - NATS_URL=nats://nats:4222
|
|
# volumes:
|
|
# - ./services/agent-registry:/app
|
|
# - ./logs:/app/logs
|
|
# depends_on:
|
|
# - postgres
|
|
# - redis
|
|
# - nats
|
|
# networks:
|
|
# - taiji-network
|
|
# restart: unless-stopped
|
|
|
|
# EU计费引擎 (Go) - 暂时禁用
|
|
# billing-engine:
|
|
# build:
|
|
# context: ./services/billing-engine
|
|
# dockerfile: Dockerfile
|
|
# container_name: taiji-billing-engine
|
|
# ports:
|
|
# - "8004:8080"
|
|
# environment:
|
|
# - DATABASE_URL=postgresql://taiji_user:taiji_pass@postgres:5432/taiji_db
|
|
# - REDIS_URL=redis://redis:6379
|
|
# - NATS_URL=nats://nats:6379
|
|
# volumes:
|
|
# - ./services/billing-engine:/app
|
|
# - ./logs:/app/logs
|
|
# depends_on:
|
|
# - postgres
|
|
# - redis
|
|
# - nats
|
|
# networks:
|
|
# - taiji-network
|
|
# restart: unless-stopped
|
|
|
|
# API网关 (Nginx)
|
|
api-gateway:
|
|
image: nginx:alpine
|
|
container_name: taiji-api-gateway
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./config/nginx.conf:/etc/nginx/nginx.conf
|
|
- ./config/ssl:/etc/nginx/ssl
|
|
depends_on:
|
|
- data-ingestion
|
|
- mcp-server
|
|
networks:
|
|
- taiji-network
|
|
restart: unless-stopped
|
|
|
|
# 监控服务 - Prometheus
|
|
prometheus:
|
|
image: prom/prometheus:latest
|
|
container_name: taiji-prometheus
|
|
ports:
|
|
- "9090:9090"
|
|
volumes:
|
|
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
|
|
- prometheus_data:/prometheus
|
|
command:
|
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
|
- '--storage.tsdb.path=/prometheus'
|
|
- '--web.console.libraries=/etc/prometheus/console_libraries'
|
|
- '--web.console.templates=/etc/prometheus/consoles'
|
|
- '--web.enable-lifecycle'
|
|
networks:
|
|
- taiji-network
|
|
restart: unless-stopped
|
|
|
|
# 监控服务 - Grafana
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
container_name: taiji-grafana
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- GF_SECURITY_ADMIN_PASSWORD=admin
|
|
volumes:
|
|
- grafana_data:/var/lib/grafana
|
|
- ./config/grafana/dashboards:/etc/grafana/provisioning/dashboards
|
|
- ./config/grafana/datasources:/etc/grafana/provisioning/datasources
|
|
depends_on:
|
|
- prometheus
|
|
networks:
|
|
- taiji-network
|
|
restart: unless-stopped
|
|
|
|
# 开发环境容器 (可选)
|
|
dev-container:
|
|
build:
|
|
context: ./dev-environment
|
|
dockerfile: Dockerfile
|
|
container_name: taiji-dev
|
|
volumes:
|
|
- .:/workspace
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
working_dir: /workspace
|
|
tty: true
|
|
stdin_open: true
|
|
networks:
|
|
- taiji-network
|
|
profiles:
|
|
- dev
|
|
|
|
networks:
|
|
taiji-network:
|
|
driver: bridge
|
|
ipam:
|
|
config:
|
|
- subnet: 172.20.0.0/16
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
nats_data:
|
|
prometheus_data:
|
|
grafana_data:
|
|
|