diff --git a/rocketchat/README.md b/rocketchat/README.md index 8815c1b..8c08d5f 100644 --- a/rocketchat/README.md +++ b/rocketchat/README.md @@ -1,4 +1,4 @@ -# Minimum File Structure +### Minimum File Structure ``` /home/ └── ~/ @@ -8,9 +8,7 @@ ├── docker-compose.yml ``` -# Things to Modify - -## Add to Caddyfile (from ~/docker/caddy) +### Add to Caddyfile (from ~/docker/caddy) Remember to `docker exec -w /etc/caddy caddy caddy reload` after editing your Caddyfile. ``` subdomain.example.com { @@ -18,7 +16,7 @@ subdomain.example.com { } ``` -## .env +### .env set your environment variables https://github.com/StarWhiz/docker_deployment_notes/blob/master/rocketchat/.env ``` @@ -32,7 +30,7 @@ SMTP_MAIL_URL=smtp.mailgun.org ROCKETCHAT_BOT_PASSWORD=samplebotpassword ``` -## docker-compose.yml +### docker-compose.yml https://github.com/StarWhiz/docker_deployment_notes/blob/master/rocketchat/docker-compose.yml ``` version: '2' @@ -124,5 +122,8 @@ networks: name: ${DOCKER_MY_NETWORK} ``` -## docker-compose up -d -After you have the .env and docker-compose files set up in this directory. Do a ```docker-compose up -d``` to start the containers. \ No newline at end of file +### docker-compose up -d +After you have the .env and docker-compose files set up in this directory. Do a ```docker-compose up -d``` to start the containers. It should take about 30-60 seconds to launch. + +### Finalization - Hubot +After you can access your rocketchat server, you can stop the hubot errors for happening by creating a new bot user in Administration > Users > + New. Then create a bot with username bot, and email bot@yourdomain.com and password to match the password you used in the .env file. Lastly, for role choose bot and hit save. Now if you do a `docker logs rocketchat-hubot` you won't see any more errors and the container will stop restarting over and over again. \ No newline at end of file diff --git a/rocketchat/docker-compose.yml b/rocketchat/docker-compose.yml deleted file mode 100644 index bb34b91..0000000 --- a/rocketchat/docker-compose.yml +++ /dev/null @@ -1,82 +0,0 @@ -version: '2' - -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: - - ./uploads:/app/uploads - environment: - - PORT=3000 - - ROOT_URL=${ROOT_URL} - - MONGO_URL=mongodb://mongo:27017/rocketchat - - MONGO_OPLOG_URL=mongodb://mongo:27017/local - - MAIL_URL=${SMTP_MAIL_URL} -# - HTTP_PROXY=http://proxy.domain.com -# - HTTPS_PROXY=http://proxy.domain.com - depends_on: - - mongo - 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: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1 - labels: - - "traefik.enable=false" - - # 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: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 - - # 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=${ROCKETCHAT_BOT_PASSWORD} - - 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 - 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 - -networks: - default: - external: - name: ${DOCKER_MY_NETWORK}