version: '3.8'

services:
  permission-service:
    build:
      context: ..
      dockerfile: deploy/Dockerfile
    container_name: permission-service
    ports:
      - "8084:8084"
    environment:
      - SPRING_PROFILES_ACTIVE=dev
      - DB_HOST=host.docker.internal
      - DB_PORT=3306
      - DB_NAME=erp_db
      - DB_USERNAME=root
      - DB_PASSWORD=nihao588+
      - REDIS_HOST=host.docker.internal
      - REDIS_PORT=6379
      - REDIS_PASSWORD=Y(@r5tGk9$Lp2
      - NACOS_HOST=host.docker.internal
      - NACOS_PORT=8848
    networks:
      - erp-network
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8084/actuator/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
    restart: unless-stopped

networks:
  erp-network:
    driver: bridge
