version: '3.8'

services:
  invoice-service:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: invoice-service
    restart: unless-stopped
    ports:
      - "8086:8086"
    environment:
      - SPRING_PROFILES_ACTIVE=prod
      - DB_HOST=111.229.80.149
      - DB_PORT=3306
      - DB_NAME=erp_db
      - DB_USER=root
      - DB_PASSWORD=nihao588+
      - REDIS_HOST=111.229.80.149
      - REDIS_PORT=6379
      - REDIS_PASSWORD=Y(@r5tGk9$Lp2
      - NACOS_SERVER=43.226.44.101:8848
      - NACOS_NAMESPACE=public
      - ROCKETMQ_NAMESRV=43.226.44.101:9876
    networks:
      - erp-network
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8086/actuator/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
    volumes:
      - /data/invoice-service/logs:/app/logs
      - /data/invoice-service/files:/app/files

networks:
  erp-network:
    external: true
