Detailed steps for installing rockerChat in docker and setting up a chat room

Detailed steps for installing rockerChat in docker and setting up a chat room

Comprehensive Documentation

github address

https://github.com/RocketChat/Rocket.Chat

docker-compose documentation

https://docs.rocket.chat/installation/docker-containers/docker-compose

Configuration Files

Get the docker-compose file

Enter the command

curl -L https://raw.githubusercontent.com/RocketChat/Rocket.Chat/develop/docker-compose.yml -o docker-compose.yml

The file content is

version: '2'
services:
  rocketchat:
   image: rocketchat/rocket.chat:latest
   command: >
     bash -c
       "for i in `seq 1 30`; do
         node main.js &&
         s=$$? && break || s=$$?;
         echo \"Tried $$i times. Waiting 5 secs...\";
         sleep 5;
       done; (exit $$s)"
   restart: unless-stopped
   volumes:
     - ./uploads:/app/uploads
   environment:
     -PORT=3000
     - ROOT_URL=http://localhost:3000
     - MONGO_URL=mongodb://mongo:27017/rocketchat
     - MONGO_OPLOG_URL=mongodb://mongo:27017/local
     - MAIL_URL=smtp://smtp.email
# - HTTP_PROXY=http://proxy.domain.com
# - HTTPS_PROXY=http://proxy.domain.com
   depends_on:
     - mongo
   ports:
     - 3000:3000
   labels:
     - "traefik.backend=rocketchat"
     - "traefik.frontend.rule=Host: your.domain.tld"
  mongo:
   image: mongo:4.0
   restart: unless-stopped
   volumes:
     - ./data/db:/data/db
     #- ./data/dump:/dump
   command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
   labels:
     - "traefik.enable=false"
  # This container's job is just running the command to initialize the replica set.
  # it will run the command and remove himself (it will not stay running)
  mongo-init-replica:
   image: mongo:4.0
   command: >
     bash -c
       "for i in `seq 1 30`; do
         mongo mongo/rocketchat --eval \"
           rs.initiate({
             _id: 'rs0',
             members: [ { _id: 0, host: 'localhost:27017' } ]})\" &&
         s=$$? && break || s=$$?;
         echo \"Tried $$i times. Waiting 5 secs...\";
         sleep 5;
       done; (exit $$s)"
   depends_on:
     - mongo
  # hubot, the popular chatbot (add the bot user first and change the password before starting this image)
  hubot:
   image: rocketchat/hubot-rocketchat:latest
   restart: unless-stopped
   environment:
     - ROCKETCHAT_URL=rocketchat:3000
     - ROCKETCHAT_ROOM=GENERAL
     -ROCKETCHAT_USER=bot
     -ROCKETCHAT_PASSWORD=botpassword
     - BOT_NAME=bot
  # you can add more scripts as you'd like here, they need to be installable by npm
     - EXTERNAL_SCRIPTS=hubot-help,hubot-seen,hubot-links,hubot-diagnostics
   depends_on:
     - rocketchat
   labels:
     - "traefik.enable=false"
   volumes:
     - ./scripts:/home/hubot/scripts
  # this is used to expose the hubot port for notifications on the host on port 3001, e.g. for hubot-jenkins-notifier
   ports:
     - 3001:8080
  #traefik:
  # image: traefik:latest
  # restart: unless-stopped
  # command: >
  # traefik
  # --docker
  # --acme=true
  # --acme.domains='your.domain.tld'
  # --acme.email='[email protected]'
  # --acme.entrypoint=https
  # --acme.storagefile=acme.json
  # --defaultentrypoints=http
  # --defaultentrypoints=https
  # --entryPoints='Name:http Address::80 Redirect.EntryPoint:https'
  # --entryPoints='Name:https Address::443 TLS.Certificates:'
  # ports:
  # - 80:80
  # - 443:443
  # volumes:
  # - /var/run/docker.sock:/var/run/docker.sock

Modify the file

nano docker-compose.yml

Change ports to a custom port, the default is 3000, here I change it to 5001

img

Start the service

Enter the command

docker-compose up -d

Access Services

Use http://IP:Port

Enter the installation wizard by default

Set administrator information

img

Set organization information

img

Set server information

img

Register Server

img

Set up for success

img

Enter the default public chat room

img

Click on the upper left corner to create a user

To test the connection between two users

img

Test text, emoji, picture, voice, video, video conference

img

Setting up https

Apply for an SSL certificate and use the IP: port number before the nginx proxy.

At the same time, the domain name is resolved to the corresponding server IP

server {
       listen 443;
       # rocketchat
       server_name rocketchat.domain.com;
       ssl on;
       #root html;
       # index index.html index.htm;
       # The SSL certificate is placed in the domain folder at the same level ssl_certificate cert/domain/rocketchat.domain.com_bundle.crt;
       ssl_certificate_key cert/domain/rocketchat.domain.com.key;
       ssl_session_timeout 5m;
       ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
       ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
       ssl_prefer_server_ciphers on;
       location / {
           #Point to a current service port proxy_pass http://127.0.0.1:5001;
           #Set the request header and pass the header information to the server proxy_redirect off;
           proxy_set_header Host $host;
           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";
       }
   }

Tips

Some services, such as voice messages, video messages, file transfers, APP applications, etc., require https protocol access.

It is recommended to configure Https in time. If you just want to try it, just use ip:port.

img

The above is the details of how to install rockerChat in docker and set up a chat room. For more information about the docker rockerChat chat room, please pay attention to other related articles on 123WORDPRESS.COM!

<<:  Five delay methods for MySQL time blind injection

>>:  Using text shadow and element shadow effects in CSS

Recommend

Detailed explanation of Vue advanced construction properties

Table of contents 1. Directive custom directive 2...

About the problem of dynamic splicing src image address of img in Vue

Let's take a look at the dynamic splicing of ...

Implementing license plate input function in WeChat applet

Table of contents Preface background Big guess Fi...

How to install and configure ftp server in CentOS8.0

After the release of CentOS8.0-1905, we tried to ...

Common HTML tag writing errors

We better start paying attention, because HTML Po...

Stop using absolute equality operators everywhere in JS

Table of contents Overview 1. Test for null value...

Practice of using Tinymce rich text to customize toolbar buttons in Vue

Table of contents Install tinymce, tinymce ts, ti...

How to deploy Oracle using Docker on Mac

How to deploy Oracle using Docker on Mac First in...

64-bit CentOs7 source code installation mysql-5.6.35 process sharing

First install the dependent packages to avoid pro...

Detailed explanation of JS browser storage

Table of contents introduction Cookie What are Co...

How to customize Docker images using Dockerfile

Customizing images using Dockerfile Image customi...

Detailed explanation of Axios asynchronous communication in Vue

1. First, we create a .json file for interactive ...

VMWare Linux MySQL 5.7.13 installation and configuration tutorial

This article shares with you the tutorial of inst...