forked from lablivre-unb/rasa-ptbr-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
269 lines (248 loc) · 6.85 KB
/
docker-compose.yml
File metadata and controls
269 lines (248 loc) · 6.85 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
version: '2'
services:
# =============================== Coach =================================
# All the models are trained by this coach.
coach:
build:
context: .
dockerfile: ./docker/bot.Dockerfile
volumes:
- ./bot/models/:/bot/models/
command: "make train"
# ================================= Bot =====================================
# Generic Rasa bot, used to run console for example.
bot:
build:
context: .
dockerfile: ./docker/bot.Dockerfile
restart: unless-stopped
volumes:
- ./bot/:/bot/
ports:
- 5006:5006
- 5004:5004
- 5005:5005
depends_on:
- actions
# ================================= RASA X ==================================
# Rasa X container
x:
build:
context: .
dockerfile: ./docker/bot.Dockerfile
restart: unless-stopped
volumes:
- ./bot/:/bot/
ports:
- 5002:5002
env_file:
- env/rasax.env
depends_on:
- actions
command: sh -c "make x"
# ================================= Actions =================================
# Rasa middleware used to connect with external APIs.
actions:
build:
context: .
dockerfile: ./docker/actions.Dockerfile
ports:
- 5055:5055
volumes:
- ./bot/actions:/bot/actions
command: sh -c "make actions"
# ============================ WebChat Bot =================================
# Specific Rasa bot integrated with WebChat.
bot-webchat-core1:
build:
context: .
dockerfile: ./docker/bot.Dockerfile
volumes:
- ./bot/:/bot/
depends_on:
- actions
command: sh -c "make webchat"
bot-webchat-core2:
build:
context: .
dockerfile: ./docker/bot.Dockerfile
volumes:
- ./bot/:/bot/
depends_on:
- actions
command: sh -c "make webchat"
# =========================== Loadbalancer =================================
# HAProxy used as loadbalancer for more than 1 instance of bot-webchat
# Use case for load balacing websockets
bot-webchat:
image: haproxy:2.3
volumes:
- "./modules/haproxy/:/usr/local/etc/haproxy:ro"
ports:
- 5007:5007
- 32700:32700
depends_on:
- bot-webchat-core1
- bot-webchat-core2
# ============================ WebChat Bot =================================
# Specific Rasa bot integrated with WebChat.
bot-rocket:
build:
context: .
dockerfile: ./docker/bot.Dockerfile
volumes:
- ./bot/:/bot/
ports:
- 5005:5005
depends_on:
- actions
command: sh -c "make rocket"
# =============================== Analytics =================================
# Analitics ElasticSearch Stack.
elasticsearch:
build:
context: .
dockerfile: ./docker/elasticsearch.Dockerfile
restart: unless-stopped
ports:
- 9200:9200
- 9300:9300
env_file:
- env/elasticsearch.env
volumes:
- esbackup:/usr/share/elasticsearch/backup
- ./modules/elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- esdata:/usr/share/elasticsearch/data
# Visualization layer of Analitics Stack.
kibana:
build:
context: .
dockerfile: ./docker/kibana.Dockerfile
restart: unless-stopped
ports:
- 5601:5601
env_file:
- env/kibana.env
depends_on:
- elasticsearch
volumes:
- ./modules/analytics:/usr/share/kibana/analytics
# =============================== Broker ====================================
# Custom broker to store Rasa tracker data.
rabbitmq:
image: rabbitmq:3-management
restart: unless-stopped
volumes:
- ./db/rabbitmq:/var/lib/rabbitmq/mnesia
ports:
- 15672:15672
env_file:
- env/rabbitmq.env
# Custom broker consumer responsible to store data into ElasticSearch.
rabbitmq-consumer:
build:
context: .
dockerfile: ./docker/consumer.Dockerfile
restart: unless-stopped
volumes:
- ./modules/rabbitmq/consumer/:/opt/scripts/
depends_on:
- rabbitmq
env_file:
- env/rabbitmq-consumer.env
command: python3 /opt/scripts/consume_bot_messages.py
# ============================ Webchat Page =================================
# A container to run webchat html page
webchat:
image: nginx
ports:
- 5010:80
volumes:
- ./modules/webchat:/usr/share/nginx/html
# ============================ Telegram Bot =================================
# Specific Rasa bot integrated with Telegram.
bot_telegram:
build:
context: .
dockerfile: ./docker/bot.Dockerfile
volumes:
- ./bot/:/bot/
env_file:
- env/bot-telegram.env
ports:
- 5001:5001
depends_on:
- actions
command: sh -c "make telegram"
# =============================== Notebooks =================================
# Rasa lab to enhance hyperparameters.
notebooks:
build:
context: .
dockerfile: ./docker/notebooks.Dockerfile
env_file:
- env/notebooks.env
volumes:
- ./modules/notebooks:/work/notebooks
- ./bot/:/bot/
ports:
- 8888:8888
# =============================== Rocket.Chat =================================
# Rocket.Chat instance and database
rocketchat:
image: rocketchat/rocket.chat:3.7.1
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:
- rocket_uploads:/app/uploads
environment:
- PORT=3000
- ROOT_URL=http://localhost:3000
- MONGO_URL=mongodb://mongo:27017/rocketchat
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
- ADMIN_USERNAME=admin
- ADMIN_PASS=admin
- ADMIN_EMAIL=mail@mail.com
depends_on:
- mongo
- mongo-init-replica
ports:
- 5003:3000
mongo:
image: mongo:4.0
restart: unless-stopped
volumes:
- mongo_data:/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
volumes:
notebook_models:
mongo_data:
rabbit_data:
esbackup:
esdata:
driver: local
rocket_uploads: