# ============================================
# Syslog Serve 部署配置 (探针端)
# ============================================
# 使用方法: docker compose -f docker-compose-serve.yaml up -d
# ============================================



services:
  # ============================================
  # Syslog Serve - 探针采集服务 (探针端)
  # ============================================
  syslog-serve:
    build:
      context: ./syslog-serve
      dockerfile: Dockerfile
    image: syslog-serve:1.0.1
    container_name: syslog-serve
    restart: unless-stopped
    environment:
      # 环境配置
      - SPRING_PROFILES_ACTIVE=dev
      - TZ=Asia/Shanghai
      # 探针标识
      - DEVICE_COLLECT_ID=1
      # 数据库配置
      - spring.datasource.url=jdbc:postgresql://117.72.68.72:54329/ecosys
      - spring.datasource.username=postgres
      - spring.datasource.password=TnLanWaidYSwTSG5
      - spring.datasource.driver-class-name=org.postgresql.Driver
      # Redis配置
      - spring.redis.host=192.168.222.131
      - spring.redis.port=6379
      - spring.redis.password=
      - spring.redis.database=0
      - spring.redis.timeout=2000
      - spring.cache.redis.time-to-live=600000
      # Kafka配置
      - spring.kafka.producer.bootstrap-servers=192.168.222.130:9092
      - spring.kafka.producer.topic=test-topic
      # 防火墙配置
      - firewall.enabled=true
      - firewall.api-key=your-secure-api-key
      # 联动配置 (syslog-consumer 地址)
      - interlocking.enabled=true
      - interlocking.api.base-url=http://192.168.222.131:8089/xdrservice/interlocking
      - interlocking.api-key=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
      # 探针心跳配置
      - probe.heartbeat.enabled=true
      - probe.heartbeat.interval-seconds=60
      - probe.heartbeat.initial-delay-ms=5000
      - probe.collect-id=probe-001
      - probe.collect-name=日志采集探针
      - probe.app-version=1.0.0
      - probe.platform.api-url=http://192.168.222.131:8089/xdrservice/interlocking/probe/heartbeat
      - probe.platform.api-key=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
      # 定时任务配置
      - spring.task.scheduling.pool.size=5
      # JVM配置
      - JAVA_OPTS=-Xms256m -Xmx1024m -XX:+UseG1GC
    ports:
      - "8189:8189"  # API端口
      - "514:514/udp"  # Syslog UDP
      - "514:514/tcp"  # Syslog TCP
    volumes:
      - /home/syslog/logs:/app/logs
    networks:
      - xdr-network
    cap_add:
      - NET_BIND_SERVICE
    privileged: true

# ============================================
# 网络配置
# ============================================
networks:
  xdr-network:
    driver: bridge

