version: '3.5'

services:
  rmqnamesrv:
    image: foxiswho/rocketmq:4.8.0
#    image: registry.cn-hangzhou.aliyuncs.com/foxiswho/rocketmq:4.7.0
    container_name: ea_rmqnamesrv
    restart: always
    ports:
      - 9876:9876
    volumes:
      - ./rmqs/logs:/home/rocketmq/logs
      - ./rmqs/store:/home/rocketmq/store
      - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime
    environment:
      JAVA_OPT_EXT: "-Duser.home=/home/rocketmq -Xms512M -Xmx512M -Xmn128m"
      JAVA_OPTS: "-Duser.timezone='Asia/Shanghai'"
    command: ["sh","mqnamesrv"]
    networks:
        ea_net:
          aliases:
            - rmqnamesrv
  rmqbroker:
    image: foxiswho/rocketmq:4.8.0
#    image: registry.cn-hangzhou.aliyuncs.com/foxiswho/rocketmq:4.7.0
    container_name: ea_rmqbroker
    restart: always
    ports:
      - 10909:10909
      - 10911:10911
    volumes:
      - ./rmq/logs:/home/rocketmq/logs
      - ./rmq/store:/home/rocketmq/store
      - ./rmq/brokerconf/broker.conf:/etc/rocketmq/broker.conf
    environment:
        JAVA_OPT_EXT: "-Duser.home=/home/rocketmq -Xms512M -Xmx512M -Xmn128m"
        JAVA_OPTS: "-Duser.timezone='Asia/Shanghai'"
    command: ["sh","mqbroker","-c","/etc/rocketmq/broker.conf","-n","ea_rmqnamesrv:9876","autoCreateTopicEnable=true"]
    depends_on:
      - rmqnamesrv
    networks:
      ea_net:
        aliases:
          - rmqbroker

  rmqconsole:
    image: styletang/rocketmq-console-ng
    container_name: ea_rmqconsole
    restart: always
    ports:
      - 18080:8080
    environment:
        JAVA_OPTS: "-Drocketmq.namesrv.addr=ea_rmqnamesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false -Duser.timezone='Asia/Shanghai'"
    depends_on:
      - rmqnamesrv
    networks:
      ea_net:
        aliases:
          - rmqconsole

networks:
  ea_net:
    external: true
