version: '3.5'

services:
  nacos:
    hostname: nacos
    image: registry.edoc2.com:5000/edoc2v5/nacos/nacos-server:udcmgt-v3.0.0.2
    environment:
      - PREFER_HOST_MODE=hostname
      - MODE=standalone
      - SPRING_DATASOURCE_PLATFORM=mysql
      - MYSQL_SERVICE_HOST=nacos-mysql
      - MYSQL_SERVICE_DB_NAME=nacos_db
      - MYSQL_SERVICE_PORT=3306
      - MYSQL_SERVICE_USER=nacos
      - MYSQL_SERVICE_PASSWORD=nacos
      - MYSQL_SERVICE_DB_PARAM=characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false
    volumes:
      - ./standalone-logs/:/home/nacos/logs
      #- ./init.d/custom.properties:/home/nacos/init.d/custom.properties
#    ports:
#      - "8848:8848"
#      - "9848:9848"
#      - "9555:9555"
    depends_on:
      - nacos-mysql
    networks: 
      - edoc2
  nacos-mysql:
    hostname: nacos-mysql
    image: registry.edoc2.com:5000/edoc2v5/nacos/nacos-mysql:udcmgt-v3.0.0.2
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=nacos_db
      - MYSQL_USER=nacos
      - MYSQL_PASSWORD=nacos
    volumes:
      - ./mysql:/var/lib/mysql
      - ./nacos-mysql.sql:/docker-entrypoint-initdb.d/nacos-mysql.sql
#    ports:
#      - "13306:3306"
    networks: 
      - edoc2
networks:
  edoc2:
    external: true
    name: macrowing
