ROCKETCHAT

Outil de travail collaboratif - Un outil pour remplacer slack en local

Installation Rocket.Chat via Docker Compose

mkdir /local/Rocket.Chat/
cd /local/Rocket.Chat/
wget https://raw.githubusercontent.com/RocketChat/Rocket.Chat/develop/docker-compose.yml
Ajuster le fichier
URL et dossier
mkdir /local/rc_data/
mkdir /local/rc_data/mongo
mkdir /local/rc_data/rocketchat
docker-compose.yml
version: '2'
 
services:
  rocketchat:
    image: rocketchat/rocket.chat:latest
    restart: unless-stopped
    volumes:
      - /local/rc_data/rocketchat/uploads:/app/uploads
    environment:
      - PORT=3000
      - ROOT_URL=http://rocketchat.domaine.fr:3000
      - MONGO_URL=mongodb://mongo:27017/rocketchat
      - MONGO_OPLOG_URL=mongodb://mongo:27017/local
      - MAIL_URL=smtp://smtp.domaine.fr
    depends_on:
      - mongo
    ports:
      - 3000:3000
 
  mongo:
    image: mongo:3.2
    restart: unless-stopped
    volumes:
     - /local/rc_data/mongo/data/db:/data/db
    command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
 
  # this container's job is just run 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:3.2
    command: 'mongo mongo/rocketchat --eval "rs.initiate({ _id: ''rs0'', members: [ { _id: 0, host: ''localhost:27017'' } ]})"'
    depends_on:
      - mongo

Les containers sont configurés pour se (re)lancer automatiquement

docker-compose up -d mongo
docker-compose up -d mongo-init-replica
docker-compose up -d rocketchat
    upstream backend-rocketchat {
        server 127.0.0.1:3000;
    }
    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  rocketchat.domaine.fr;
        root         /usr/share/nginx/html;
 
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;
 
        location / {
                proxy_pass  http://backend-rocketchat/;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_set_header Host $http_host;
 
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forward-Proto http;
                proxy_set_header X-Nginx-Proxy true;
 
                proxy_redirect off;
 
        }
    }
docker pull rocketchat/rocket.chat:latest
docker-compose stop rocketchat
docker-compose rm rocketchat
docker-compose up -d rocketchat

/local/Rocket.Chat/docker-compose_backupmongo.yml

/docker-compose_backupmongo.yml
version: '2'
services:
  mongo-backup:
    image: mongo:3.2
    volumes:
      - /local/backup/mongo:/backup
    command: 'mongodump --out /backup --host mongo'

/etc/cron.daily/backupmongo.cron

backupmongo.cron
#!/bin/bash
 
docker-compose -f /local/Rocket.Chat/docker-compose_backupmongo.yml up

Retour

Vous pourriez laisser un commentaire si vous étiez connecté.