RocketChat¶
Docker Compose安装¶
# 下载官方配置
curl -L https://raw.githubusercontent.com/RocketChat/Docker.Official.Image/master/compose.yml -O
# 配置 .env 文件
curl -L https://raw.githubusercontent.com/RocketChat/Docker.Official.Image/master/env.example -o .env
# 启动
docker compose up -d
# 停止
docker compose down
备份¶
# 查看数据库位置
docker inspect rocketchat-mongodb-1 | grep Source
# 执行备份命令
docker exec rocketchat-mongodb-1 mongodump --archive=/bitnami/mongodb/rocketchat_backup.gz --gzip
# 恢复备份
docker exec -i rocketchat-mongodb-1 mongorestore --archive=/bitnami/mongodb/rocketchat_backup.gz --gzip
参考¶
.env配置
### Rocket.Chat configuration
# Rocket.Chat version
# see:- https://github.com/RocketChat/Rocket.Chat/releases
RELEASE=7.2.0
# MongoDB endpoint (include ?replicaSet= parameter)
# 設定 MongoDB 連接字串 (如果您使用外部 MongoDB):如果您使用容器內建的 MongoDB,則不需要修改或設定 MONGO_URL
#MONGO_URL=
# MongoDB endpoint to the local database
#MONGO_OPLOG_URL=
# IP to bind the process to
BIND_IP=127.0.0.1
# URL used to access your Rocket.Chat instance
# 設定訪問網址:替換為您的域名
ROOT_URL=https://chat.lyricn.com
# Port Rocket.Chat runs on (in-container)
# 默认为3000
#PORT=
# Port on the host to bind to
#HOST_PORT=
### MongoDB configuration
# MongoDB version/image tag
#MONGODB_VERSION=
# See:- https://hub.docker.com/r/bitnami/mongodb
### Traefik config (if enabled)
# Traefik version/image tag
#TRAEFIK_RELEASE=
# Domain for https (change ROOT_URL & BIND_IP accordingly)
#DOMAIN=
# Email for certificate notifications
#LETSENCRYPT_EMAIL=
nginx配置
location / {
proxy_redirect off;
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
client_max_body_size 100m;
client_body_buffer_size 128k;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; # WebSocket 支援
proxy_set_header Connection "upgrade"; # WebSocket 支援
}