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

User needs lead to marketing-oriented design

<br />For each of our topics, the team will ...

The docker-maven-plugin plugin cannot pull the corresponding jar package

When using the docker-maven-plugin plug-in, Maven...

Web page layout should consider IE6 compatibility issues

The figure below shows the browser viewing rate i...

React+TypeScript project construction case explanation

React project building can be very simple, but if...

...

Vue implements horizontal scrolling of marquee style text

This article shares the specific code for Vue to ...

Installation steps of mysql under linux

1. Download the mysql tar file: https://dev.mysql...

Detailed explanation of using grep command in Linux

Linux grep command The Linux grep command is used...

Detailed explanation of the use of Vue image drag and drop zoom component

The specific usage of the Vue image drag and drop...

An example of how to optimize a project after the Vue project is completed

Table of contents 1. Specify different packaging ...

Advantages of MySQL covering indexes

A common suggestion is to create indexes for WHER...

Native JavaScript implementation of progress bar

The specific code for JavaScript to implement the...

Process analysis of deploying ASP.NET Core applications on Linux system Docker

Table of contents 1. System environment 2. Operat...

Solution to MySql Error 1698 (28000)

1. Problem description: MysqlERROR1698 (28000) so...

How to install JDK 13 in Linux environment using compressed package

What is JDK? Well, if you don't know this que...