initial plugins
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
# rocketchat
|
||||
rocketchat:
|
||||
image: rocket.chat:latest
|
||||
container_name: mistborn_production_rocketchat
|
||||
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:
|
||||
- ../../mistborn_volumes/extra/rocketchat/uploads:/app/uploads
|
||||
environment:
|
||||
- PORT=3000
|
||||
- ROOT_URL=http://chat.mistborn
|
||||
- MONGO_URL=mongodb://mongo:27017/rocketchat
|
||||
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
|
||||
- Accounts_UseDNSDomainCheck=False
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.chat-http.rule=Host(`chat.mistborn`)"
|
||||
- "traefik.http.routers.chat-http.entrypoints=web"
|
||||
- "traefik.http.routers.chat-http.middlewares=mistborn_auth@file"
|
||||
- "traefik.http.routers.chat-https.rule=Host(`chat.mistborn`)"
|
||||
- "traefik.http.routers.chat-https.entrypoints=websecure"
|
||||
- "traefik.http.routers.chat-https.middlewares=mistborn_auth@file"
|
||||
- "traefik.http.routers.chat-https.tls.certresolver=basic"
|
||||
- "traefik.http.services.chat-service.loadbalancer.server.port=3000"
|
||||
depends_on:
|
||||
- mongo
|
||||
#ports:
|
||||
# - 3000:3000
|
||||
|
||||
mongo:
|
||||
image: mongo:4.0
|
||||
container_name: mistborn_production_rocketchat_mongo
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ../../mistborn_volumes/extra/rocketchat/data/db:/data/db
|
||||
- ../../mistborn_volumes/extra/rocketchat/data/dump:/dump
|
||||
command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
|
||||
|
||||
# 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
|
||||
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
|
||||
container_name: mistborn_production_rocketchat_hubot
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- ROCKETCHAT_URL=chat.mistborn #:3000
|
||||
# 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
|
||||
env_file:
|
||||
- ../.envs/.production/.rocketchat
|
||||
depends_on:
|
||||
- rocketchat
|
||||
volumes:
|
||||
- ../../mistborn_volumes/extra/rocketchat/hubot/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:
|
||||
- "${MISTBORN_BIND_IP}:3001:8080/tcp"
|
||||
|
||||
networks:
|
||||
default:
|
||||
external:
|
||||
name: mistborn_default
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# generate rocketchat .env files
|
||||
ROCKETCHAT_PROD_FILE="$1"
|
||||
#ROCKETCHAT_PASSWORD=$(python3 -c "import secrets; import string; print(f''.join([secrets.choice(string.ascii_letters+string.digits) for x in range(32)]))")
|
||||
ROCKETCHAT_PASSWORD="${MISTBORN_DEFAULT_PASSWORD}"
|
||||
echo "ROCKETCHAT_USER=bot" > $ROCKETCHAT_PROD_FILE
|
||||
echo "ROCKETCHAT_ROOM=GENERAL" >> $ROCKETCHAT_PROD_FILE
|
||||
echo "BOT_NAME=bot" >> $ROCKETCHAT_PROD_FILE
|
||||
echo "ROCKETCHAT_PASSWORD=$ROCKETCHAT_PASSWORD" >> $ROCKETCHAT_PROD_FILE
|
||||
|
||||
# docker environment
|
||||
echo "MISTBORN_BIND_IP=${MISTBORN_BIND_IP}" >> $ROCKETCHAT_PROD_FILE
|
||||
|
||||
chmod 600 $ROCKETCHAT_PROD_FILE
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,9 @@
|
||||
[DEFAULT]
|
||||
name = rocketchat
|
||||
subdomain = rocketchat
|
||||
desc = Rocket.Chat is the leading open source team chat software solution.
|
||||
img = img/rocketchat.png
|
||||
compose = compose/docker-compose.yml
|
||||
service = service/plugin.service
|
||||
environment = environment/environment.sh
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
[Unit]
|
||||
Description=Mistborn Rocket Chat Service
|
||||
Requires=Mistborn-base.service
|
||||
After=Mistborn-base.service
|
||||
PartOf=Mistborn-base.service
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
RestartSec=15
|
||||
User=root
|
||||
Group=docker
|
||||
PermissionsStartOnly=true
|
||||
# Shutdown container (if running) when unit is stopped
|
||||
ExecStartPre=/opt/mistborn/scripts/wrappers/mistborn_docker.sh rocketchat docker-compose -f /opt/mistborn/extra/rocketchat.yml down
|
||||
|
||||
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p tcp --dport 3001 -j MISTBORN_LOG_DROP
|
||||
# Start container when unit is started
|
||||
ExecStart=/opt/mistborn/scripts/wrappers/mistborn_docker.sh rocketchat docker-compose -f /opt/mistborn/extra/rocketchat.yml up --build
|
||||
# Stop container when unit is stopped
|
||||
ExecStop=/opt/mistborn/scripts/wrappers/mistborn_docker.sh rocketchat docker-compose -f /opt/mistborn/extra/rocketchat.yml down
|
||||
# Post stop
|
||||
ExecStopPost=-/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 3001 -j MISTBORN_LOG_DROP
|
||||
|
||||
[Install]
|
||||
WantedBy=Mistborn-base.service
|
||||
Reference in New Issue
Block a user