services: # ======================== Go 后端服务 (连接外部 MySQL/Redis) ======================== backend: build: context: . dockerfile: backend/Dockerfile args: VERSION: ${VERSION:-dev} BUILD_TIME: ${BUILD_TIME:-unknown} container_name: aiops-backend hostname: aiops-backend restart: unless-stopped ports: - "8080:8080" volumes: - ./backend/config.external.yaml:/app/config.yaml - /var/run/docker.sock:/var/run/docker.sock healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s extra_hosts: - "host.docker.internal:host-gateway" networks: - aiops-network # ======================== React 前端 + Nginx ======================== frontend: build: context: ./frontend dockerfile: Dockerfile container_name: aiops-frontend hostname: aiops-frontend restart: unless-stopped ports: - "80:80" depends_on: backend: condition: service_healthy networks: - aiops-network networks: aiops-network: driver: bridge