version: '3.8' services: higress-agent: build: . container_name: higress-agent ports: - "8080:8080" environment: - OPENAI_API_KEY=${OPENAI_API_KEY} - GITHUB_TOKEN=${GITHUB_TOKEN} - DEEPWIKI_API_KEY=${DEEPWIKI_API_KEY} - AGENT_PORT=8080 - AGENT_DEBUG=false - LOG_LEVEL=info - LOG_FORMAT=json volumes: - ./configs:/app/configs:ro - ./logs:/app/logs - ./data:/app/data restart: unless-stopped healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/api/v1/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s networks: - higress-network # Redis缓存(可选) redis: image: redis:7-alpine container_name: higress-redis ports: - "6379:6379" volumes: - redis_data:/data restart: unless-stopped networks: - higress-network profiles: - cache # PostgreSQL数据库(可选) postgres: image: postgres:15-alpine container_name: higress-postgres environment: - POSTGRES_DB=higress_agent - POSTGRES_USER=higress - POSTGRES_PASSWORD=password ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data restart: unless-stopped networks: - higress-network profiles: - database # Nginx反向代理(可选) nginx: image: nginx:alpine container_name: higress-nginx ports: - "80:80" - "443:443" volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro - ./ssl:/etc/nginx/ssl:ro depends_on: - higress-agent restart: unless-stopped networks: - higress-network profiles: - proxy # Prometheus监控(可选) prometheus: image: prom/prometheus:latest container_name: higress-prometheus ports: - "9090:9090" volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro - 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' - '--storage.tsdb.retention.time=200h' - '--web.enable-lifecycle' restart: unless-stopped networks: - higress-network profiles: - monitoring # Grafana可视化(可选) grafana: image: grafana/grafana:latest container_name: higress-grafana ports: - "3000:3000" environment: - GF_SECURITY_ADMIN_PASSWORD=admin volumes: - grafana_data:/var/lib/grafana depends_on: - prometheus restart: unless-stopped networks: - higress-network profiles: - monitoring networks: higress-network: driver: bridge volumes: redis_data: postgres_data: prometheus_data: grafana_data: