Skip to content

Instantly share code, notes, and snippets.

@stefanandres
Last active February 11, 2018 10:13
Show Gist options
  • Save stefanandres/9a37f5f61b5d4ae14d39dcce1ba4e04e to your computer and use it in GitHub Desktop.
Save stefanandres/9a37f5f61b5d4ae14d39dcce1ba4e04e to your computer and use it in GitHub Desktop.
# docker-compose up -d up
# (initially) docker-compose up -d mongo-init-replica
# docker-compose up -d traefik
# docker-compose up -d rocketchat
#
# update rc:
# docker-compose pull && docker-compose up -d rocketchat
#
version: '2'
services:
rocketchat:
image: rocketchat/rocket.chat:latest
restart: unless-stopped
volumes:
- ./uploads:/app/uploads
environment:
- MONGO_URL=mongodb://mongo:27017/rocketchat
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
#- MAIL_URL=smtp://smtp.email
- ROOT_URL=https://chat.sandres.de
- Accounts_UseDNSDomainCheck="false"
depends_on:
- mongo
ports:
- 3000:3000
labels:
- "traefik.backend=rocketchat"
- "traefik.frontend.rule=Host: chat.sandres.de"
mongo:
image: mongo:3.2
restart: unless-stopped
volumes:
- ./data/db:/data/db
command: mongod --smallfiles --oplogSize 128 --replSet rs0
labels:
- "traefik.enable=false"
mongo-backup:
image: "istepanov/mongodump:3.2"
volumes:
- ./backup/:/backup
environment:
CRON_SCHEDULE: '0 1 * * *'
depends_on:
- mongo
# 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
# 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=databerlin
- ROCKETCHAT_USER=willi
- ROCKETCHAT_PASSWORD=...
- BOT_NAME=willi
- ROCKETCHAT_URL=https://chat.sandres.de # needded for hubot-dau
# weather API key
- HUBOT_OWM_APIKEY=...
# 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,hubot-reload-scripts,hubot-weather
depends_on:
- rocketchat
labels:
- "traefik.enable=false"
volumes:
- ./scripts:/home/hubot/scripts
# this is used to expose the hubot port for notifications on the host on port 3001, e.g. for hubot-jenkins-notifier
# ports:
# - 3001:8080
traefik:
image: traefik:latest
restart: unless-stopped
command: traefik --docker --acme=true --acme.domains='chat.sandres.de' --acme.email='sa@sandres.de' --acme.entrypoint=https --acme.httpChallenge.entryPoint=http --acme.storage=acme.json defaultentrypoints=http --defaultEntryPoints=http,https --entryPoints='Name:http Address::80 Redirect.EntryPoint:https' --entryPoints='Name:https Address::443 TLS'
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment