version: '3.8'

services:
  product-service:
    build:
      context: .
      dockerfile: src/main/resources/deployment/Dockerfile
    container_name: erp-product-service
    ports:
      - "8083:8083"
    environment:
      - SPRING_PROFILES_ACTIVE=prod
      - DB_HOST=mysql
      - DB_PORT=3306
      - DB_NAME=erp_java
      - DB_USERNAME=erp_user
      - DB_PASSWORD=erp123456
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - REDIS_PASSWORD=redis123456
      - NACOS_SERVER=nacos:8848
      - NACOS_NAMESPACE=public
      - JAVA_OPTS=-Xms512m -Xmx1024m
    depends_on:
      mysql:
        condition: service_healthy
      redis:
        condition: service_healthy
      nacos:
        condition: service_healthy
    networks:
      - erp-network
    restart: unless-stopped
    volumes:
      - product-service-logs:/var/log/product-service

networks:
  erp-network:
    external: true

volumes:
  product-service-logs:
    driver: local
