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

What are the usages of limit in MySQL (recommended)

SELECT * FROM table name limit m,n; SELECT * FROM...

MySQL latest version 8.0.17 decompression version installation tutorial

Personally, I think the decompressed version is e...

Detailed explanation of Vue's TodoList case

<template> <div id="root"> ...

Specific use of Docker anonymous mount and named mount

Table of contents Data volume Anonymous and named...

Detailed process of Vue front-end packaging

Table of contents 1. Add packaging command 2. Run...

Nginx compiled nginx - add new module

1. View existing modules /usr/local/nginx/sbin/ng...

JS implements city list effect based on VUE component

This article example shares the specific code for...

Detailed explanation of the solution to docker-compose being too slow

There is only one solution, that is to change the...

Navicat remote connection to MySQL implementation steps analysis

Preface I believe that everyone has been developi...

Write a formal blog using XHTML CSS

The full name of Blog should be Web log, which me...

Detailed explanation of template tag usage (including summary of usage in Vue)

Table of contents 1. Template tag in HTML5 2. Pro...

How to implement function currying and decurrying in Javascript

Function currying (black question mark face)? ? ?...

W3C Tutorial (11): W3C DOM Activities

The Document Object Model (DOM) is a platform, a ...

select the best presets to create full compatibility with all browsersselect

We know that the properties of the select tag in e...