# 使用说明 V4.0.0
# 1. 使用docker-compose  宿主机不需要配置host来发现
# 2. 无需修改源码，根目录  docker-compose up 即可
# 3. 静静等待服务启动

version: '2'
services:
  lutao-mysql:
    build:
      context: ./db
    environment:
      MYSQL_ROOT_HOST: "%"
      MYSQL_ROOT_PASSWORD:
    restart: always
    container_name: lutao-mysql
    image: mysql:8.0.23
    security_opt:
      - seccomp:unconfined
    ports:
      - 3306:3306
    volumes:
      - ./lutao-mysql:/var/lib/mysql
    command: --lower_case_table_names=1


  accident-nginx:
    build:
      context: ./accident/accident-web
    restart: always
    container_name: accident-nginx
    image: accident-nginx
    ports:
      - 8090:8090
#  wuye-server:
#    build:
#      context: ./wuye/c#/wuye-c#
#    restart: always
#    container_name: wuye-server
#    image: wuye-server:1.0.0
#    ports:
#      - 8060:80

  cloud-redis:
    image: redis:6.2
    container_name: cloud-redis
    restart: always
    environment:
      - TZ=Asia/Shanghai
    ports:
      - "6379:6379"
    volumes:
      - ./data/redis/redis.conf:/usr/local/etc/redis/redis.conf
      - ./data/redis/data:/data:rw
      - ./data/redis/logs:/logs
    command:  redis-server /usr/local/etc/redis/redis.conf --requirepass "haspm123"

  nacos:
    hostname: nacos
    restart: always
    container_name: nacos
    image: nacos/nacos-server:v2.1.0
    env_file:
      - ./accident/nacos/env/nacos-standlone-mysql.env
    volumes:
      - ./accident/nacos/standalone-logs/:/home/nacos/logs
      - ./accident/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties
    ports:
      - "8848:8848"
      - "9848:9848"
      - "9555:9555"
  nacos1:
    hostname: nacos1
    image: nacos/nacos-server:v2.1.0
    container_name: nacos1
    env_file:
      - ./accident/nacos/env/nacos-standlone-mysql.env
    volumes:
      - ./accident/nacos/standalone-logs/:/home/nacos/logs
      - ./accident/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties
    ports:
      - "8849:8848"
      - "9849:9848"
    restart: always
  #网关服务
  cloud-gateway:
    build:
      context: ./accident/cloud-gateway
    restart: always
    container_name: cloud-gateway
    image: cloud-gateway
    ports:
      - "9999:9999"
  cloud-gateway1:
    build:
      context: ./accident/cloud-gateway
    container_name: cloud-gateway1
    image: cloud-gateway
    ports:
      - "9900:9999"

  ##认证中心
  cloud-auth:
    build:
      context: ./accident/cloud-auth
    restart: always
    container_name: cloud-auth
    image: cloud-auth
    ports:
      - "3000:3000"
  cloud-auth1:
    build:
      context: ./accident/cloud-auth
    restart: always
    container_name: cloud-auth1
    image: cloud-auth
    ports:
      - "3000:3000"
  #权限管理
  cloud-upms:
    build:
      context: ./accident/cloud-upms
    container_name: cloud-upms
    image: cloud-upms
    ports:
      - "4000:4000"
  cloud-upms1:
    build:
      context: ./accident/cloud-upms
    restart: always
    container_name: cloud-upms1
    image: cloud-upms
    ports:
      - "4000:4000"
  ##首页
  cloud-index:
    build:
      context: ./accident/cloud-index
    container_name: cloud-index
    image: cloud-index
    ports:
      - "9001:9001"

  ## 事故资源
  cloud-res:
    build:
      context: ./accident/cloud-res
    container_name: cloud-res
    image: cloud-res
    ports:
      - "9003:9003"

  ## 事故字典
  cloud-dict:
    build:
      context: ./accident/cloud-dict
    container_name: cloud-dict
    image: cloud-dict
    ports:
      - "9005:9005"

  ## 标准库
  cloud-collect:
    build:
      context: ./accident/cloud-collect
    container_name: cloud-collect
    image: cloud-collect
    ports:
      - "9007:9007"

  ## 事故管理
  cloud-accident:
    build:
      context: ./accident/cloud-accident
    container_name: cloud-accident
    image: cloud-accident
    ports:
      - "9009:9009"

  ## 事故管理
  cloud-storage:
    build:
      context: ./accident/cloud-storage
    container_name: cloud-storage
    image: cloud-storage
    ports:
      - "9011:9011"
  ## 事故取证
  cloud-evidence:
    build:
      context: ./accident/cloud-evidence
    container_name: cloud-evidence
    image: cloud-evidence
    ports:
      - "9013:9013"
  #三方服务器
#  cloud-mqtt:
#    container_name: cloud-mqtt
#    image: emqx/emqx:v4.0.0
#    restart: always
#    ports:
#      - "1883:1883"
#      - "8083:8083"
  cloud-mqtt:
    build:
      context: ./accident/cloud-mqtt
    container_name: cloud-mqtt
    image: cloud-mqtt
    restart: always
    ports:
      - "9876:9876"
      - "8083:8083"
      - "8083:8083"

  ## 事故鉴定
  cloud-identify:
    build:
      context: ./accident/cloud-identify
    container_name: cloud-identify
    image: cloud-identify
    ports:
      - "9014:9014"
  ## 消息中心
  cloud-message:
    build:
      context: ./accident/cloud-message
    container_name: cloud-message
    image: cloud-message
    ports:
      - "9017:9017"

  #  haspm-oa-platform:
  #    build:
  #      context: ./haspm-visual/haspm-oa-platform
  #    restart: always
  #    image: haspm-oa-platform
  #    container_name: haspm-oa-platform
  ##分布式事物管理
  #  haspm-tx-manager:
  #    build:
  #      context: ./haspm-visual/haspm-tx-manager
  #    restart: always
  #    image: haspm-tx-manager
  #    container_name: haspm-tx-manager
  #    ports:
  #      - 5004:5004
  #      - 9998:9998
  ##哨兵流控
  #  haspm-sentinel:
  #    build:
  #      context: ./haspm-visual/haspm-sentinel-dashboard
  #    restart: always
  #    image: haspm-sentinel
  #    container_name: haspm-sentinel
  #    ports:
  #      - 5020:5020
  ##消息系统
  #  haspm-message:
  #    build:
  #      context: ./haspm-message
  #    restart: always
  #    container_name: haspm-message
  #    image: haspm-message
  # mongo服务
#  haspm-mongo:
#    container_name: haspm-mongo
#    image: mongo:4.4.14 # 可以修改为自己需要的版本
#    restart: always
#    ports:
#      - 27017:27017
#    volumes:
#      - /etc/localtime:/etc/localtime # 时区
#      - /home/guoyc/haspm-mongo/db:/data/db # 挂载数据目录
#      - /home/guoyc/haspm-mongo/log:/var/log/mongodb  # 挂载日志目录
#      - /home/guoyc/haspm-mongo/config:/etc/mongo  # 挂载配置目录
#      - /home/guoyc/haspm-mongo/backup:/data/backup # 挂载备份
#    environment:
#      MONGO_INITDB_ROOT_USERNAME: mongoadmin
#      MONGO_INITDB_ROOT_PASSWORD: mongoadmin
