mirror of
https://github.com/nickyeoman/docker-compose-cookbooks.git
synced 2026-09-03 18:36:22 +00:00
Updated rocketchat to template format
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
- Every stack has at least 3 files: `compose.yaml` (dockhand style), `sample.env`, `README.md`
|
||||
- `_dev` = experimental, `_notes` = docs/minimal examples, no suffix = production-ready
|
||||
- Always references an external `proxy` network (`docker network create proxy` once)
|
||||
- Always references an external `proxy` network (managed by Nginx Proxy Manager; `docker network create proxy` once)
|
||||
- Volumes use `${VOL_PATH:-/data}` as the base path (absolute `/data`, never `./data`); project directories use `${VOL_PROJECTS:-/data}`
|
||||
- Timezone defaults to `America/Vancouver`, but only include if the container requires it.
|
||||
- Restart policy, image tag, and port are configurable via env vars with sensible defaults
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
# Rocket.Chat
|
||||
|
||||
## Overview
|
||||
|
||||
Rocket.Chat is an open-source team messaging platform. This stack includes Rocket.Chat, MongoDB with replica set initialization, and an optional Hubot chatbot.
|
||||
|
||||
## Project Details
|
||||
|
||||
- **Project Repository:** [https://github.com/RocketChat/Rocket.Chat](https://github.com/RocketChat/Rocket.Chat)
|
||||
- **Container Image:** [Docker Hub](https://hub.docker.com/_/rocket-chat)
|
||||
- **Documentation:** [https://docs.rocket.chat](https://docs.rocket.chat)
|
||||
- **Reverse Proxy Port:** `3000`
|
||||
|
||||
## Getting Started
|
||||
|
||||
1. Start the stack: `docker compose up -d`
|
||||
2. Open https://${ROCKETCHAT_DOMAIN} in your browser
|
||||
3. Follow the setup wizard to configure your Rocket.Chat instance
|
||||
|
||||
## Environment Variable Notes
|
||||
|
||||
VOL_PATH – base path for persistent data volumes
|
||||
VOL_PROJECTS – base path for project directories
|
||||
ROCKETCHAT_IMAGE – Rocket.Chat container image (default: rocketchat/rocket.chat:latest)
|
||||
ROCKETCHAT_RESTART – restart policy (default: unless-stopped)
|
||||
ROCKETCHAT_DOMAIN – domain name for reverse proxy access
|
||||
ROCKETCHAT_PORT – host port mapped to container port 3000 (default: 3000)
|
||||
MONGO_IMAGE – MongoDB container image (default: mongo:4.0)
|
||||
HUBOT_IMAGE – Hubot chatbot image (default: rocketchat/hubot-rocketchat:latest)
|
||||
|
||||
## Volume Notes
|
||||
|
||||
${VOL_PATH}/rocketchat_dev/uploads – Rocket.Chat file uploads
|
||||
${VOL_PATH}/rocketchat_dev/db – MongoDB data directory
|
||||
${VOL_PATH}/rocketchat_dev/dump – MongoDB dump directory
|
||||
${VOL_PATH}/rocketchat_dev/hubot-scripts – Hubot custom scripts
|
||||
|
||||
## Network Notes
|
||||
|
||||
Requires the external `proxy` network. An internal bridge network `internal` is created for inter-service communication.
|
||||
|
||||
## Docker Run
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name rocketchat \
|
||||
-v ${VOL_PATH:-/data}/rocketchat_dev/uploads:/app/uploads \
|
||||
-e PORT=3000 \
|
||||
-e ROOT_URL=http://chat.example.com:3000 \
|
||||
-e MONGO_URL=mongodb://mongo:27017/rocketchat \
|
||||
-e MONGO_OPLOG_URL=mongodb://mongo:27017/local \
|
||||
-p 3000:3000 \
|
||||
--network proxy \
|
||||
rocketchat/rocket.chat:latest
|
||||
```
|
||||
|
||||
## Additional Notes / Gotchas
|
||||
|
||||
- MongoDB uses the `mmapv1` storage engine with `--smallfiles` and `--oplogSize 128` for compatibility with Rocket.Chat.
|
||||
- The `mongo-init-replica` service initializes the MongoDB replica set and exits. It must complete before Rocket.Chat starts.
|
||||
- Hubot requires a bot user to be created in Rocket.Chat before it can connect. Update the password in the compose file or environment.
|
||||
|
||||
## Dockhand Stack, Deploy from Git
|
||||
|
||||
Cookbooks Repository
|
||||
stackname: ROCKETCHAT_DEV
|
||||
Compose file path: rocketchat_dev/compose.yaml
|
||||
Additional env file (optional): rocketchat_dev/sample.env
|
||||
|
||||
Then "Load" rocketchat_dev/sample.env into the Environmental variables in dockhand
|
||||
|
||||
Create the Stack
|
||||
@@ -0,0 +1,82 @@
|
||||
# Rocket.Chat
|
||||
|
||||
services:
|
||||
rocketchat:
|
||||
image: ${ROCKETCHAT_IMAGE:-rocketchat/rocket.chat:latest}
|
||||
restart: ${ROCKETCHAT_RESTART:-unless-stopped}
|
||||
|
||||
volumes:
|
||||
- ${VOL_PATH:-/data}/rocketchat_dev/uploads:/app/uploads
|
||||
|
||||
environment:
|
||||
- PORT=3000
|
||||
- ROOT_URL=http://${ROCKETCHAT_DOMAIN:-localhost}:3000
|
||||
- MONGO_URL=mongodb://mongo:27017/rocketchat
|
||||
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
|
||||
- MAIL_URL=smtp://smtp.email
|
||||
|
||||
ports:
|
||||
- "${ROCKETCHAT_PORT:-3000}:3000"
|
||||
|
||||
networks:
|
||||
- proxy
|
||||
- internal
|
||||
|
||||
depends_on:
|
||||
- mongo
|
||||
|
||||
mongo:
|
||||
image: ${MONGO_IMAGE:-mongo:4.0}
|
||||
restart: ${ROCKETCHAT_RESTART:-unless-stopped}
|
||||
|
||||
volumes:
|
||||
- ${VOL_PATH:-/data}/rocketchat_dev/db:/data/db
|
||||
- ${VOL_PATH:-/data}/rocketchat_dev/dump:/dump
|
||||
|
||||
command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
|
||||
|
||||
networks:
|
||||
- internal
|
||||
|
||||
mongo-init-replica:
|
||||
image: ${MONGO_IMAGE:-mongo:4.0}
|
||||
|
||||
command: >
|
||||
mongo mongo/rocketchat --eval
|
||||
"rs.initiate({
|
||||
_id: 'rs0',
|
||||
members: [ { _id: 0, host: 'localhost:27017' } ]
|
||||
})"
|
||||
|
||||
networks:
|
||||
- internal
|
||||
|
||||
depends_on:
|
||||
- mongo
|
||||
|
||||
hubot:
|
||||
image: ${HUBOT_IMAGE:-rocketchat/hubot-rocketchat:latest}
|
||||
restart: ${ROCKETCHAT_RESTART:-unless-stopped}
|
||||
|
||||
volumes:
|
||||
- ${VOL_PATH:-/data}/rocketchat_dev/hubot-scripts:/home/hubot/scripts
|
||||
|
||||
environment:
|
||||
- ROCKETCHAT_URL=rocketchat:3000
|
||||
- ROCKETCHAT_ROOM=GENERAL
|
||||
- ROCKETCHAT_USER=bot
|
||||
- ROCKETCHAT_PASSWORD=botpassword
|
||||
- BOT_NAME=bot
|
||||
- EXTERNAL_SCRIPTS=hubot-help,hubot-seen,hubot-links,hubot-diagnostics
|
||||
|
||||
networks:
|
||||
- internal
|
||||
|
||||
depends_on:
|
||||
- rocketchat
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
internal:
|
||||
driver: bridge
|
||||
@@ -1,92 +0,0 @@
|
||||
###############################################################################
|
||||
# Rocket Chat
|
||||
# Update the .env file
|
||||
# make sure you use the $PREFIX from .env for project_name
|
||||
# docker-compose -p project_name up -d
|
||||
###############################################################################
|
||||
|
||||
volumes:
|
||||
rocketchat:
|
||||
rocketchat-db:
|
||||
rocketchat-dump:
|
||||
rocketchat-scripts:
|
||||
|
||||
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:
|
||||
- rocketchat:/app/uploads
|
||||
networks:
|
||||
- admin_web
|
||||
environment:
|
||||
- PORT=3000
|
||||
- ROOT_URL=http://${ROCKET_DOMAIN_NAME}:3000
|
||||
- MONGO_URL=mongodb://${PREFIX}_mongo_1:27017/rocketchat
|
||||
- MONGO_OPLOG_URL=mongodb://${PREFIX}_mongo_1:27017/local
|
||||
- MAIL_URL=smtp://smtp.email
|
||||
# - HTTP_PROXY=http://proxy.domain.com
|
||||
# - HTTPS_PROXY=http://proxy.domain.com
|
||||
depends_on:
|
||||
- mongo
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.${PREFIX}_chat.rule=Host(`${ROCKET_DOMAIN_NAME}`)"
|
||||
- "traefik.http.routers.${PREFIX}_chat.entrypoints=websecure"
|
||||
- "traefik.http.routers.${PREFIX}_chat.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.services.${PREFIX}_chat.loadbalancer.server.port=3000"
|
||||
|
||||
mongo:
|
||||
image: mongo:4.0
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- rocketchat-db:/data/db
|
||||
- rocketchat-dump:/dump
|
||||
networks:
|
||||
- admin_web
|
||||
command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
|
||||
|
||||
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
|
||||
networks:
|
||||
- admin_web
|
||||
|
||||
# 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
|
||||
volumes:
|
||||
- rocketchat-scripts:/home/hubot/scripts
|
||||
networks:
|
||||
- admin_web
|
||||
@@ -1,6 +0,0 @@
|
||||
# Domains & Project
|
||||
PREFIX=p1
|
||||
ROCKET_DOMAIN_NAME=chat.nickyeoman.com
|
||||
|
||||
# Software versions
|
||||
ROCKETCHAT_V=3.1.1
|
||||
@@ -0,0 +1,15 @@
|
||||
# ===== Paths =====
|
||||
VOL_PATH=/data
|
||||
VOL_PROJECTS=/data/projects
|
||||
|
||||
# ===== Rocket.Chat =====
|
||||
ROCKETCHAT_IMAGE=rocketchat/rocket.chat:latest
|
||||
ROCKETCHAT_RESTART=unless-stopped
|
||||
ROCKETCHAT_DOMAIN=chat.example.com
|
||||
ROCKETCHAT_PORT=3000
|
||||
|
||||
# ===== MongoDB =====
|
||||
MONGO_IMAGE=mongo:4.0
|
||||
|
||||
# ===== Hubot =====
|
||||
HUBOT_IMAGE=rocketchat/hubot-rocketchat:latest
|
||||
Reference in New Issue
Block a user