ansible-role-rocketchat/templates/docker-compose.yml.j2

68 lines
1.8 KiB
Plaintext
Raw Normal View History

version: '3.7'
services:
rocketchat:
image: rocket.chat:{{ rc_version }}
command: >
bash -c
"for (( ; ; )); do
node main.js &&
s=$$? && break || s=$$?;
echo \"Could not start Rocket.Chat. 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
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: >
bash -c
"while [ ! -f /data/db/WiredTiger ]; do
echo \"wiredTiger migration hasn't started yet. Waiting 30 secs...\";
sleep 30;
done;
docker-entrypoint.sh mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger;"
depends_on:
- migrator
labels:
- "traefik.enable=false"
migrator:
build: ./docker/
volumes:
- ./data/db:/data/db
mongo-init-replica:
image: mongo:4.0
command: >
bash -c
"for (( ; ; )); do
mongo mongo/rocketchat --eval \"
rs.initiate({
_id: 'rs0',
members: [ { _id: 0, host: 'localhost:27017' } ]})\" &&
s=$$? && break || s=$$?;
echo \"Could not reach MongoDB. Waiting 5 secs ...\";
sleep 5;
done; (exit $$s)"
depends_on:
- mongo