# docker-compose.dev.yml (开发环境 - 一键启动所有服务) version: '3.8' services: # ========== 基础设施 ========== postgres: image: pgvector/pgvector:pg16 environment: POSTGRES_USER: cyrene POSTGRES_PASSWORD: cyrene_pass 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" # ========== 后端服务 ========== memory-service: build: context: ./backend/memory-service dockerfile: Dockerfile environment: PORT: "8091" POSTGRES_HOST: postgres POSTGRES_PORT: "5432" POSTGRES_USER: cyrene POSTGRES_PASSWORD: cyrene_pass POSTGRES_DB: cyrene_ai ports: - "8091:8091" depends_on: postgres: condition: service_healthy restart: unless-stopped tool-engine: build: context: ./backend/tool-engine dockerfile: Dockerfile environment: PORT: "8092" IOT_SERVICE_URL: http://iot-debug-service:8083 DATA_DIR: /tmp/cyrene_data DB_URL: "postgres://cyrene:cyrene_pass@postgres:5432/cyrene_ai?sslmode=disable" ports: - "8092:8092" depends_on: postgres: condition: service_healthy restart: unless-stopped voice-service: build: context: ./backend/voice-service dockerfile: Dockerfile environment: PORT: "8093" WHISPER_BINARY: "./whisper.cpp/main" WHISPER_MODEL: "./whisper.cpp/models/ggml-small.bin" WHISPER_LANGUAGE: "zh" ports: - "8093:8093" restart: unless-stopped 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: cyrene_pass POSTGRES_DB: cyrene_ai IOT_DEBUG_SERVICE_URL: http://iot-debug-service:8083 ENABLE_BACKGROUND_THINKING: ${ENABLE_BACKGROUND_THINKING:-true} ports: - "8081:8081" depends_on: postgres: condition: service_healthy iot-debug-service: condition: service_started restart: unless-stopped iot-debug-service: build: context: ./backend/iot-debug-service dockerfile: Dockerfile environment: IOT_DEBUG_PORT: "8083" ports: - "8083:8083" 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 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: cyrene POSTGRES_PASSWORD: cyrene_pass 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 memory-service: condition: service_started tool-engine: condition: service_started voice-service: condition: service_started restart: unless-stopped volumes: pg_data: redis_data: qdrant_data: minio_data: