1 version: '2' 2 3 services: 4 rocketchat: 5 image: registry.rocket.chat/rocketchat/rocket.chat:latest 6 command: > 7 bash -c 8 "for i in `seq 1 30`; do 9 node main.js && 10 s=$$? && break || s=$$?; 11 echo \"Tried $$i times. Waiting 5 secs...\"; 12 sleep 5; 13 done; (exit $$s)" 14 restart: unless-stopped 15 volumes: 16 - ./uploads:/app/uploads 17 environment: 18 - PORT=3000 19 - ROOT_URL=http://localhost:3000 20 - MONGO_URL=mongodb://mongo:27017/rocketchat 21 - MONGO_OPLOG_URL=mongodb://mongo:27017/local 22 - REG_TOKEN=${REG_TOKEN} 23 # - MAIL_URL=smtp://smtp.email 24 # - HTTP_PROXY=http://proxy.domain.com 25 # - HTTPS_PROXY=http://proxy.domain.com 26 depends_on: 27 - mongo 28 ports: 29 - 3000:3000 30 labels: 31 - "traefik.backend=rocketchat" 32 - "traefik.frontend.rule=Host: your.domain.tld" 33 34 mongo: 35 image: mongo:4.0 36 restart: unless-stopped 37 volumes: 38 - ./data/db:/data/db 39 #- ./data/dump:/dump 40 command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1 41 labels: 42 - "traefik.enable=false" 43 44 # this container's job is just run the command to initialize the replica set. 45 # it will run the command and remove himself (it will not stay running) 46 mongo-init-replica: 47 image: mongo:4.0 48 command: > 49 bash -c 50 "for i in `seq 1 30`; do 51 mongo mongo/rocketchat --eval \" 52 rs.initiate({ 53 _id: 'rs0', 54 members: [ { _id: 0, host: 'localhost:27017' } ]})\" && 55 s=$$? && break || s=$$?; 56 echo \"Tried $$i times. Waiting 5 secs...\"; 57 sleep 5; 58 done; (exit $$s)" 59 depends_on: 60 - mongo 61 62 #traefik: 63 # image: traefik:latest 64 # restart: unless-stopped 65 # command: > 66 # traefik 67 # --docker 68 # --acme=true 69 # --acme.domains='your.domain.tld' 70 # --acme.email='your@email.tld' 71 # --acme.entrypoint=https 72 # --acme.storagefile=acme.json 73 # --defaultentrypoints=http 74 # --defaultentrypoints=https 75 # --entryPoints='Name:http Address::80 Redirect.EntryPoint:https' 76 # --entryPoints='Name:https Address::443 TLS.Certificates:' 77 # ports: 78 # - 80:80 79 # - 443:443 80 # volumes: 81 # - /var/run/docker.sock:/var/run/docker.sock