Skip to content

Commit 2ee5337

Browse files
author
Sean P. Kane
committed
Add Rocketchat server compose support
1 parent 65196fd commit 2ee5337

13 files changed

+278
-0
lines changed

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bot-with-server
2+
deploy
3+
node_modules
4+
terraform

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ newrelic.js
1616
srbot.rake
1717
centurion-configs
1818
.env
19+
20+
terraform/terraform.tfstate*
21+
terraform/.terraformmongodb/data/db/*
22+
bot-with-server/mongodb/data/db/*
23+
!bot-with-server/mongodb/data/db/.git_keep
24+

bot-with-server/compose.env

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file should be updated and copied to .env
2+
STUDENT_ID=unknown
3+
HUB_USER=unknown
4+
HUBOT_ADAPTER=slack
5+
ROCKETCHAT_URL=rocketchat:3000
6+
ROCKETCHAT_USER=hubot
7+
ROCKETCHAT_PASSWORD=mybot-pw!!

bot-with-server/docker-compose.yaml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
version: '2.3'
2+
services:
3+
rocketchat:
4+
image: rocketchat/rocket.chat:0.61.0
5+
restart: unless-stopped
6+
volumes:
7+
- "~/docker-workshop/hubot-docker/bot-with-server/rocketchat/data/uploads:/app/uploads"
8+
environment:
9+
PORT: 3000
10+
ROOT_URL: "http://127.0.0.1:3000"
11+
MONGO_URL: "mongodb://mongo:27017/rocketchat"
12+
MONGO_OPLOG_URL: "mongodb://mongo:27017/local"
13+
MAIL_URL: "smtp://smtp.email"
14+
depends_on:
15+
- mongo
16+
ports:
17+
- 3000:3000
18+
labels:
19+
- "traefik.backend=rocketchat"
20+
- "traefik.frontend.rule=Host: your.domain.tld"
21+
networks:
22+
- my-net
23+
mongo:
24+
image: spkane/mongo:3.2
25+
restart: unless-stopped
26+
volumes:
27+
- "~/docker-workshop/hubot-docker/bot-with-server/mongodb/data/db:/data/db"
28+
command: mongod --smallfiles --oplogSize 128 --replSet rs0
29+
labels:
30+
- "traefik.enable=false"
31+
networks:
32+
- my-net
33+
mongo-init-replica:
34+
image: spkane/mongo:3.2
35+
command: 'mongo mongo/rocketchat --eval "rs.initiate({ _id: ''rs0'', members: [ { _id: 0, host: ''127.0.0.1:27017'' } ]})"'
36+
depends_on:
37+
- mongo
38+
networks:
39+
- my-net
40+
mybot:
41+
build:
42+
context: ".."
43+
image: "${HUB_USER}/mybot:latest"
44+
environment:
45+
BIND_ADDRESS: "0.0.0.0"
46+
ENVIRONMENT: "development"
47+
SERVICE_NAME: "${STUDENT_ID}_bot"
48+
SERVICE_ENV: "development"
49+
EXPRESS_USER: "${STUDENT_ID}_bot"
50+
EXPRESS_PASSWORD: "${STUDENT_ID}_pw"
51+
PORT: "8080"
52+
HUBOT_ADAPTER: "rocketchat"
53+
HUBOT_ALIAS: "${STUDENT_ID}"
54+
HUBOT_NAME: "${STUDENT_ID}_bot"
55+
HUBOT_LOG_LEVEL: "debug"
56+
REDIS_URL: "redis://redis:6379"
57+
RESPOND_TO_DM: "true"
58+
ROCKETCHAT_URL: "${ROCKETCHAT_URL}"
59+
ROCKETCHAT_ROOM: ""
60+
LISTEN_ON_ALL_PUBLIC: "true"
61+
ROCKETCHAT_USER: "${ROCKETCHAT_USER}"
62+
ROCKETCHAT_PASSWORD: "${ROCKETCHAT_PASSWORD}"
63+
ROCKETCHAT_AUTH: "password"
64+
ports:
65+
- "8080:8080"
66+
depends_on:
67+
- rocketchat
68+
- redis
69+
networks:
70+
- my-net
71+
redis:
72+
image: "redis:3.2.5"
73+
expose:
74+
- "6379"
75+
networks:
76+
- my-net
77+
networks:
78+
my-net:
79+
driver: bridge

bot-with-server/mongodb/data/db/.git_keep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env powershell
2+
3+
$BASE = "$HOME\docker-class-201"
4+
5+
Write-Host "This will reset all the class data under $BASE !!!"
6+
Write-Host ""
7+
Write-Host "Are you sure this is what you want to do?"
8+
9+
$confirmation = Read-Host "You must type 'yes' to confirm: "
10+
if ($confirmation -eq 'yes') {
11+
rm "$BASE/layout/mongodb/data/db/*" -r -fo
12+
rm "$BASE/layout/rocketchat/data/uploads/*" -r -fo
13+
rm "$BASE/layout/hubot/data/scripts/*" -r -fo
14+
rm "$BASE/layout/postgres/data/data" -r -fo
15+
rm "$BASE/layout/registry/data/docker" -r -fo
16+
rm "$BASE/layout/jenkins/data/*" -r -fo
17+
rm "$BASE/layout/jenkins/data/.groovy" -r -fo
18+
rm "$BASE/layout/jenkins/data/.java" -r -fo
19+
rm "$BASE/layout/gogs/data/git" -r -fo
20+
rm "$BASE/layout/gogs/data/gogs" -r -fo
21+
rm "$BASE/layout/gogs/data/ssh" -r -fo
22+
cp "$BASE/layout/postgres/data/.git_keep" "$BASE/layout/jenkins/data/.git_keep"
23+
cp "$BASE/layout/postgres/data/.git_keep" "$BASE/layout/mongodb/data/db/.git_keep"
24+
Write-Host "completed"
25+
} else {
26+
Write-Host "aborted"
27+
}
28+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
BASE="${HOME}/docker-class-201"
4+
5+
echo "This will reset all the class data under ${BASE} !!!"
6+
echo
7+
echo "Are you sure this is what you want to do?"
8+
read -p "You must type 'yes' to confirm: " -r
9+
echo
10+
if [[ $REPLY == "yes" ]]; then
11+
rm -rf ${BASE}/layout/mongodb/data/db/*
12+
rm -rf ${BASE}/layout/rocketchat/data/uploads/*
13+
rm -rf ${BASE}/layout/hubot/data/scripts/*
14+
rm -rf ${BASE}/layout/postgres/data/data
15+
rm -rf ${BASE}/layout/registry/data/docker
16+
rm -rf ${BASE}/layout/jenkins/data/*
17+
rm -rf ${BASE}/layout/jenkins/data/.groovy
18+
rm -rf ${BASE}/layout/jenkins/data/.java
19+
rm -rf ${BASE}/layout/gogs/data/git
20+
rm -rf ${BASE}/layout/gogs/data/gogs
21+
rm -rf ${BASE}/layout/gogs/data/ssh
22+
echo "completed"
23+
else
24+
echo "aborted"
25+
fi
26+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env powershell
2+
3+
$BASE = "$HOME\docker-class-201"
4+
5+
Write-Host "This will reset all the Jenkins data under $BASE !!!"
6+
Write-Host ""
7+
Write-Host "Are you sure this is what you want to do?"
8+
9+
$confirmation = Read-Host "You must type 'yes' to confirm: "
10+
if ($confirmation -eq 'yes') {
11+
rm "$BASE/layout/jenkins/data/*" -r -fo
12+
rm "$BASE/layout/jenkins/data/.groovy" -r -fo
13+
rm "$BASE/layout/jenkins/data/.java" -r -fo
14+
cp "$BASE/layout/postgres/data/.git_keep" "$BASE/layout/jenkins/data/.git_keep"
15+
Write-Host "completed"
16+
} else {
17+
Write-Host "aborted"
18+
}
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
BASE="${HOME}/docker-class-201"
4+
5+
echo "This will reset all the Jenkins data under ${BASE} !!!"
6+
echo
7+
echo "Are you sure this is what you want to do?"
8+
read -p "You must type 'yes' to confirm: " -r
9+
echo
10+
if [[ $REPLY == "yes" ]]; then
11+
rm -rf ${BASE}/layout/jenkins/data/*
12+
rm -rf ${BASE}/layout/jenkins/data/.groovy
13+
rm -rf ${BASE}/layout/jenkins/data/.java
14+
echo "completed"
15+
else
16+
echo "aborted"
17+
fi
18+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env powershell
2+
3+
$BASE = "$HOME\docker-workshop"
4+
5+
Write-Host "This will reset all the class data under $BASE !!!"
6+
Write-Host ""
7+
Write-Host "Are you sure this is what you want to do?"
8+
9+
$confirmation = Read-Host "You must type 'yes' to confirm: "
10+
if ($confirmation -eq 'yes') {
11+
rm "$BASE/layout/mongodb/data/db/*" -r -fo
12+
rm "$BASE/layout/rocketchat/data/uploads/*" -r -fo
13+
rm "$BASE/layout/hubot/data/scripts/*" -r -fo
14+
rm "$BASE/layout/postgres/data/data" -r -fo
15+
rm "$BASE/layout/registry/data/docker" -r -fo
16+
rm "$BASE/layout/jenkins/data/*" -r -fo
17+
rm "$BASE/layout/jenkins/data/.groovy" -r -fo
18+
rm "$BASE/layout/jenkins/data/.java" -r -fo
19+
rm "$BASE/layout/gogs/data/git" -r -fo
20+
rm "$BASE/layout/gogs/data/gogs" -r -fo
21+
rm "$BASE/layout/gogs/data/ssh" -r -fo
22+
cp "$BASE/layout/postgres/data/.git_keep" "$BASE/layout/jenkins/data/.git_keep"
23+
cp "$BASE/layout/postgres/data/.git_keep" "$BASE/layout/mongodb/data/db/.git_keep"
24+
Write-Host "completed"
25+
} else {
26+
Write-Host "aborted"
27+
}
28+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
BASE="${HOME}/docker-workshop"
4+
5+
echo "This will reset all the class data under ${BASE} !!!"
6+
echo
7+
echo "Are you sure this is what you want to do?"
8+
read -p "You must type 'yes' to confirm: " -r
9+
echo
10+
if [[ $REPLY == "yes" ]]; then
11+
rm -rf ${BASE}/layout/mongodb/data/db/*
12+
rm -rf ${BASE}/layout/rocketchat/data/uploads/*
13+
rm -rf ${BASE}/layout/hubot/data/scripts/*
14+
rm -rf ${BASE}/layout/postgres/data/data
15+
rm -rf ${BASE}/layout/registry/data/docker
16+
rm -rf ${BASE}/layout/jenkins/data/*
17+
rm -rf ${BASE}/layout/jenkins/data/.groovy
18+
rm -rf ${BASE}/layout/jenkins/data/.java
19+
rm -rf ${BASE}/layout/gogs/data/git
20+
rm -rf ${BASE}/layout/gogs/data/gogs
21+
rm -rf ${BASE}/layout/gogs/data/ssh
22+
echo "completed"
23+
else
24+
echo "aborted"
25+
fi
26+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env powershell
2+
3+
$BASE = "$HOME\docker-workshop"
4+
5+
Write-Host "This will reset all the Jenkins data under $BASE !!!"
6+
Write-Host ""
7+
Write-Host "Are you sure this is what you want to do?"
8+
9+
$confirmation = Read-Host "You must type 'yes' to confirm: "
10+
if ($confirmation -eq 'yes') {
11+
rm "$BASE/layout/jenkins/data/*" -r -fo
12+
rm "$BASE/layout/jenkins/data/.groovy" -r -fo
13+
rm "$BASE/layout/jenkins/data/.java" -r -fo
14+
cp "$BASE/layout/postgres/data/.git_keep" "$BASE/layout/jenkins/data/.git_keep"
15+
Write-Host "completed"
16+
} else {
17+
Write-Host "aborted"
18+
}
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
BASE="${HOME}/docker-workshop"
4+
5+
echo "This will reset all the Jenkins data under ${BASE} !!!"
6+
echo
7+
echo "Are you sure this is what you want to do?"
8+
read -p "You must type 'yes' to confirm: " -r
9+
echo
10+
if [[ $REPLY == "yes" ]]; then
11+
rm -rf ${BASE}/layout/jenkins/data/*
12+
rm -rf ${BASE}/layout/jenkins/data/.groovy
13+
rm -rf ${BASE}/layout/jenkins/data/.java
14+
echo "completed"
15+
else
16+
echo "aborted"
17+
fi
18+

0 commit comments

Comments
 (0)