version: '3.8'

services:
  gateway:
    build:
      context: ..
      dockerfile: docker/Dockerfile
    container_name: erp-gateway
    ports:
      - "8080:8080"
    environment:
      - SPRING_PROFILES_ACTIVE=docker
      - NACOS_SERVER=192.168.1.100:8848
      - NACOS_USERNAME=nacos
      - NACOS_PASSWORD=nacos
      - REDIS_HOST=192.168.1.100
      - REDIS_PORT=6379
      - JWT_SECRET=your-256-bit-secret-key-for-jwt-token-generation-erp
      - SENTINEL_DASHBOARD=192.168.1.100:8080
    networks:
      - erp-network
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/actuator/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s

networks:
  erp-network:
    external: true
