-
Notifications
You must be signed in to change notification settings - Fork 203
/
docker-compose-rocket.yml
115 lines (109 loc) · 2.95 KB
/
docker-compose-rocket.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
version: "3.9"
services:
# ================================= Bot =====================================
# Generic Rasa bot, used to run console for example.
bot:
build:
context: .
dockerfile: ./docker/bot.Dockerfile
args:
RASA_VERSION: ${RASA_VERSION}
container_name: bot
env_file:
- ./bot/.env
volumes:
- ./bot/:/bot/
ports:
- 5005:5005
depends_on:
- actions
- mongo
networks:
- bot
command: make api
# ============================ Tracker Store=================================
# A mongodb container as rasa tracker store.
mongo:
container_name: mongo
image: mongo:6.0
restart: unless-stopped
env_file:
- env/bot.env
ports:
- 27017:27017
networks:
- bot
volumes:
- ./data/db:/data/db
# ================================= Actions =================================
# Rasa middleware used to connect with external APIs.
actions:
build:
context: .
dockerfile: ./docker/actions.Dockerfile
container_name: actions
env_file:
- ./env/bot.env
ports:
- 5055:5055
volumes:
- ./bot:/bot
command: sh -c "python -m rasa_sdk --actions actions"
networks:
- bot
# =============================== Rocket.Chat =================================
# Rocket.Chat instance.
rocketchat:
image: registry.rocket.chat/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=http://localhost:3000
- MONGO_URL=mongodb://mongo-rocket:27017/rocketchat
- MONGO_OPLOG_URL=mongodb://mongo-rocket:27017/local
#- REG_TOKEN=${REG_TOKEN}
depends_on:
- mongo-rocket
ports:
- 3000:3000
# =============================== Mongo =================================
# Mongo database and replica set.
mongo-rocket:
image: mongo:4.0
restart: unless-stopped
volumes:
- ./data/db:/data/db
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: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-rocket
volumes:
mongo_data:
rocket_uploads:
networks:
bot:
driver: bridge