version: '3.8'

services:
  approval-flow-service:
    build:
      context: .
      dockerfile: deployment/Dockerfile
    image: erp-approval-flow-service:latest
    container_name: approval-flow-service
    ports:
      - "8086:8086"
    environment:
      - SPRING_PROFILES_ACTIVE=prod
      - DB_HOST=mysql
      - DB_PORT=3306
      - DB_NAME=erp_db
      - DB_USERNAME=root
      - DB_PASSWORD=nihao588+
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - REDIS_PASSWORD=Y(@r5tGk9$Lp2
      - NACOS_HOST=nacos
      - NACOS_PORT=8848
    depends_on:
      - mysql
      - redis
      - nacos
    networks:
      - erp-network
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "wget", "-q", "--spider", "http://localhost:8086/actuator/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s

networks:
  erp-network:
    external: true
