Files
Cyrene/docker-compose.yml
T
AskaEth 4b35736f73 fix: 修复19个Bug (P0-P3) — 持续性调试第7轮发现的问题
P0 (5): crypto/rand session ID, TTS fallback可达性, goroutine defer recover, adminAuth前缀修正
P1 (5): 普通用户密码验证, context传递, priority clamp, 超时重试, 自主思考速率限制
P2 (4): Briefing AI降级, 前端消息类型渲染, Docker Compose补全, PWA 192图标
P3 (5): goroutine错误处理, .gitignore完善, reminder created_at, voice Dockerfile, Go版本更新
2026-05-20 13:30:32 +08:00

155 lines
4.0 KiB
YAML

# docker-compose.yml (生产环境)
version: '3.8'
services:
# ========== 反向代理 ==========
caddy:
image: caddy:2-alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
depends_on:
- gateway
restart: unless-stopped
# ========== 后端服务 ==========
gateway:
build: ./backend/gateway
environment:
GATEWAY_PORT: "8080"
ENV: production
JWT_SECRET: ${JWT_SECRET}
JWT_EXPIRY_HOURS: "720"
AI_CORE_URL: http://ai-core:8081
MEMORY_SERVICE_URL: http://memory-service:8091
TOOL_ENGINE_URL: http://tool-engine:8092
VOICE_SERVICE_URL: http://voice-service:8093
IOT_DEBUG_SERVICE_URL: http://iot-debug-service:8083
POSTGRES_HOST: postgres
POSTGRES_PORT: "5432"
POSTGRES_USER: ${POSTGRES_USER:-cyrene}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:-cyrene_ai}
REDIS_HOST: redis
REDIS_PORT: "6379"
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
ai-core:
build: ./backend/ai-core
environment:
AI_CORE_PORT: "8081"
PERSONA_DIR: "./internal/persona"
LLM_API_URL: ${LLM_API_URL}
LLM_API_KEY: ${LLM_API_KEY}
LLM_MODEL: ${LLM_MODEL:-gpt-4o}
LLM_FALLBACK_MODEL: ${LLM_FALLBACK_MODEL:-gpt-4o-mini}
POSTGRES_HOST: postgres
POSTGRES_PORT: "5432"
POSTGRES_USER: ${POSTGRES_USER:-cyrene}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:-cyrene_ai}
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
memory-service:
build: ./backend/memory-service
environment:
PORT: "8091"
POSTGRES_HOST: postgres
POSTGRES_PORT: "5432"
POSTGRES_USER: ${POSTGRES_USER:-cyrene}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:-cyrene_ai}
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
tool-engine:
build: ./backend/tool-engine
environment:
PORT: "8092"
IOT_SERVICE_URL: http://iot-debug-service:8083
DATA_DIR: /tmp/cyrene_data
DB_URL: "postgres://${POSTGRES_USER:-cyrene}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-cyrene_ai}?sslmode=disable"
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
voice-service:
build: ./backend/voice-service
environment:
PORT: "8093"
WHISPER_BINARY: "./whisper.cpp/main"
WHISPER_MODEL: "./whisper.cpp/models/ggml-small.bin"
WHISPER_LANGUAGE: "zh"
restart: unless-stopped
iot-debug-service:
build: ./backend/iot-debug-service
environment:
IOT_DEBUG_PORT: "8083"
restart: unless-stopped
# ========== 基础设施 ==========
postgres:
image: pgvector/pgvector:pg16
volumes:
- pg_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER:-cyrene}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:-cyrene_ai}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-cyrene} -d ${POSTGRES_DB:-cyrene_ai}"]
interval: 10s
timeout: 3s
retries: 5
restart: unless-stopped
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
restart: unless-stopped
qdrant:
image: qdrant/qdrant:latest
volumes:
- qdrant_data:/qdrant/storage
restart: unless-stopped
minio:
image: minio/minio:latest
command: server /data
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY}
volumes:
- minio_data:/data
restart: unless-stopped
volumes:
caddy_data:
pg_data:
redis_data:
qdrant_data:
minio_data: