# https://raw.githubusercontent.com/RocketChat/Docker.Official.Image/master/compose.yml
version: "3"

services:
  rocketchat:
    image: registry.rocket.chat/rocketchat/rocket.chat:6.3.1
    restart: always
    environment:
      MONGO_URL: "mongodb://mongodb:27017/rocketchat?replicaSet=rs0"
      MONGO_OPLOG_URL: "mongodb:mongodb:27017/local?replicaSet=rs0"
      ROOT_URL: http://localhost:3000
      PORT: 3000
      DEPLOY_METHOD: docker
      REG_TOKEN: lovemm.23
    depends_on:
      - mongodb
    expose:
      - 3456
    ports:
      - "127.0.0.1:3456:3000"

  mongodb:
    image: docker.io/bitnami/mongodb:5.0
    restart: always
    volumes:
      - /data/rocket-chat/mongodb_data:/bitnami/mongodb
    environment:
      MONGODB_REPLICA_SET_MODE: primary
      MONGODB_REPLICA_SET_NAME: rs0
      MONGODB_PORT_NUMBER: 27017
      MONGODB_INITIAL_PRIMARY_HOST: mongodb
      MONGODB_INITIAL_PRIMARY_PORT_NUMBER: 27017
      MONGODB_ADVERTISED_HOSTNAME: mongodb
      MONGODB_ENABLE_JOURNAL: "true"
      ALLOW_EMPTY_PASSWORD: "yes"