version: "3" #docker-compose版本
services: #定义container
  # 时序数据库
  keyer-influxdb:
    image: influxdb:2.7.1 #镜像
    container_name: keyer-influxdb # 容器名称
    #privileged: true
    networks:
      - keyer_network
    restart: always
    ports:
     - "8098:8086"
     - "8083:8083"
    environment:
      - DOCKER_INFLUXDB_INIT_MODE=setup
      - DOCKER_INFLUXDB_INIT_USERNAME=admin
      - DOCKER_INFLUXDB_INIT_PASSWORD=lkgl123456
      - DOCKER_INFLUXDB_INIT_ORG=org
      - DOCKER_INFLUXDB_INIT_BUCKET=industry_book
      - DOCKER_INFLUXDB_INIT_RETENTION=30d
      - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=keyersoftkeyersoft
      - DOCKER_INFLUXDB_INIT_QUERY_LOG_ENABLED=true
    # volumes:
    #   - ${PWD}/docker/influxdb/config:/etc/influxdb2
    #   - ${PWD}/docker/influxdb/data:/var/lib/influxdb2
    #   - ${PWD}/docker/influxdb/logs:/var/log/influxdb2
  # emqx
  keyer-emqx:
    image: emqx/emqx:5.3.0
    container_name: keyer-emqx
    networks:
      - keyer_network
    restart:  always
    ports:
      - "1883:1883"
      - "8183:8083"
      - "8084:8084"
      - "8883:8883"
      - "18083:18083"
    volumes:
      - ${PWD}/emqx/etc:/opt/emqx/etc
      - ${PWD}/emqx/data:/opt/emqx/data
      - ${PWD}/emqx/log:/opt/emqx/log
  # 消息中间件,科尔加入延迟消息插件
  keyer-rabbitmq:
    image: guitarpig/rabbitmq:3.12-management
    container_name: keyer-rabbitmq
    networks:
      - keyer_network
    restart: always
    ports:
      - "5672:5672"
      - "15672:15672"
    environment:
      RABBITMQ_DEFAULT_USER: "admin"
      RABBITMQ_DEFAULT_PASS: "lkgl123456"
    volumes:
      - ${PWD}/rabbitmq/data:/var/lib/rabbitmq
      - ${PWD}/rabbitmq/logs:/var/log/rabbitmq
  # 文件预览服务。科尔镜像
  keyer-kkfileview:
    #image: guitarpig/kkfileview:4.1.0
    image: guitarpig/kkfileview:4.1.0
    container_name: keyer-kkfileview
    networks:
      - keyer_network
    restart: always
    ports:
      - "8012:8012"
    volumes:
      - ${PWD}/kkfileview/config/application.properties:/opt/kkFileView-4.1.0-SNAPSHOT/config/application.properties
      - ${PWD}/kkfileview/data/file:/opt/kkFileView-4.1.0-SNAPSHOT/file
      - ${PWD}/kkfileview/logs:/opt/kkFileView-4.1.0-SNAPSHOT/log
  # redis
#   keyer-redis:
#     image: redis:7.0
#     container_name: keyer-redis
#     networks:
#       - keyer_network
#     restart: always
#     ports:
#       - "6379:6379"
#     volumes:
#       - ${PWD}/docker/redis/config/redis.conf:/usr/local/etc/redis/redis.conf
#       - ${PWD}/docker/redis/data:/data
#       - ${PWD}/docker/redis/logs:/var/log/redis
#     #user: "${UID}:${GID}"
#     command: redis-server /usr/local/etc/redis/redis.conf
  # xxljob
#  keyer-xxljob:
#    image: xuxueli/xxl-job-admin:2.4.0
#    container_name: keyer-xxljob
#    networks:
#      - keyer_network
#    restart: always
#    ports:
#      - 18080:8080
#    environment:
#      PARAMS: "--spring.datasource.url=jdbc:mysql://192.168.110.52:8096/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai  --spring.datasource.username=xxl_job  --spring.datasource.password=Lkgl123456~"
#    volumes:
#      - ${PWD}/xxljob/logs:/data/applogs

networks:
  keyer_network:
    # driver: bridge
    # ipam:
    #   config:
    #     - subnet: 172.28.0.0/16
