117 lines
2.6 KiB
YAML
117 lines
2.6 KiB
YAML
# docker-compose.dev.yml (开发环境 - 一键启动所有服务)
|
|
version: '3.8'
|
|
|
|
services:
|
|
# ========== 基础设施 ==========
|
|
postgres:
|
|
image: pgvector/pgvector:pg16
|
|
environment:
|
|
POSTGRES_USER: cyrene
|
|
POSTGRES_PASSWORD: change_me
|
|
POSTGRES_DB: cyrene_ai
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- pg_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U cyrene -d cyrene_ai"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis_data:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 5
|
|
|
|
qdrant:
|
|
image: qdrant/qdrant:latest
|
|
ports:
|
|
- "6333:6333"
|
|
- "6334:6334"
|
|
volumes:
|
|
- qdrant_data:/qdrant/storage
|
|
|
|
minio:
|
|
image: minio/minio:latest
|
|
command: server /data --console-address ":9001"
|
|
environment:
|
|
MINIO_ROOT_USER: minioadmin
|
|
MINIO_ROOT_PASSWORD: minioadmin
|
|
ports:
|
|
- "9000:9000"
|
|
- "9001:9001"
|
|
volumes:
|
|
- minio_data:/data
|
|
|
|
nats:
|
|
image: nats:2-alpine
|
|
ports:
|
|
- "4222:4222"
|
|
- "8222:8222"
|
|
|
|
# ========== 后端服务 ==========
|
|
ai-core:
|
|
build:
|
|
context: ./backend/ai-core
|
|
dockerfile: Dockerfile
|
|
environment:
|
|
AI_CORE_PORT: "8081"
|
|
PERSONA_DIR: "./internal/persona"
|
|
LLM_API_URL: ${LLM_API_URL:-https://api.openai.com/v1}
|
|
LLM_API_KEY: ${LLM_API_KEY:-sk-xxxxx}
|
|
LLM_MODEL: ${LLM_MODEL:-gpt-4o}
|
|
LLM_FALLBACK_MODEL: ${LLM_FALLBACK_MODEL:-gpt-4o-mini}
|
|
POSTGRES_HOST: postgres
|
|
POSTGRES_PORT: "5432"
|
|
POSTGRES_USER: cyrene
|
|
POSTGRES_PASSWORD: change_me
|
|
POSTGRES_DB: cyrene_ai
|
|
ports:
|
|
- "8081:8081"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
gateway:
|
|
build:
|
|
context: ./backend/gateway
|
|
dockerfile: Dockerfile
|
|
environment:
|
|
GATEWAY_PORT: "8080"
|
|
ENV: development
|
|
JWT_SECRET: ${JWT_SECRET:-dev-secret-change-in-production}
|
|
JWT_EXPIRY_HOURS: "720"
|
|
AI_CORE_URL: http://ai-core:8081
|
|
POSTGRES_HOST: postgres
|
|
POSTGRES_PORT: "5432"
|
|
POSTGRES_USER: cyrene
|
|
POSTGRES_PASSWORD: change_me
|
|
POSTGRES_DB: cyrene_ai
|
|
REDIS_HOST: redis
|
|
REDIS_PORT: "6379"
|
|
ports:
|
|
- "8080:8080"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
ai-core:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
pg_data:
|
|
redis_data:
|
|
qdrant_data:
|
|
minio_data:
|