version: '3.8'

services:
  warehouse-service:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: warehouse-service
    ports:
      - "8084:8084"
    environment:
      # 数据库配置
      - DB_HOST=111.229.80.149
      - DB_USER=root
      - DB_PASS=nihao588+
      # Redis配置
      - REDIS_HOST=111.229.80.149
      - REDIS_PORT=6379
      - REDIS_PASS=Y(@r5tGk9$Lp2
      # Nacos配置
      - NACOS_HOST=111.229.80.149
      - NACOS_PORT=8848
      - NACOS_NAMESPACE=public
      # JVM配置
      - JVM_OPTS=-Xms256m -Xmx512m -XX:+UseG1GC
    networks:
      - erp-network
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8084/actuator/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s

networks:
  erp-network:
    external: true
