-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
317 lines (292 loc) · 8.57 KB
/
docker-compose.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
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
version: "3.4"
x-database-credentials: &database-credentials
DB_HOST: "db"
DB_PORT: "5432"
DB_USER: "${DB_USER}"
DB_PASSWORD: "${DB_PASSWORD}"
DB_LOGIN_DB: "${DB_DATABASE}"
x-rabbitmq-credentials: &rabbitmq-credentials
RABBITMQ_HOST: "rabbit"
RABBITMQ_USERNAME: "user"
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
x-redis-credentials: &redis-credentials
REDIS_HOST: "redis"
REDIS_PORT: "6379"
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_DB: "1"
REDIS_CACHE_DB: "2"
ACCEPTABLE_QUERY_COUNT_NUMBER: "50000"
x-duckling-credentials: &duckling-credentials
RASA_DUCKLING_HTTP_URL: "http://duckling:8000"
x-nginx-host-variables: &nginx-host-variables
RASA_X_HOST: "rasa-x:5002"
RASA_USER_APP: "action-server:5055"
RASA_PRODUCTION_HOST: "rasa-production:5005"
BOT_FRONTEND_HOST: "botfrontend:8000"
x-rasax-credentials: &rasax-credentials
RASA_X_HOST: "http://rasa-x:5002"
RASA_X_USERNAME: ${RASA_X_USERNAME:-admin}
RASA_X_PASSWORD: ${RASA_X_PASSWORD:-}
RASA_X_TOKEN: ${RASA_X_TOKEN}
JWT_SECRET: ${JWT_SECRET}
RASA_USER_APP: "http://action-server:5055"
RASA_PRODUCTION_HOST: "http://rasa-production:5005"
# RASA_WORKER_HOST: "http://rasa-worker:5005"
RASA_TOKEN: ${RASA_TOKEN}
x-rasa-credentials: &rasa-credentials
<<: *rasax-credentials
<<: *duckling-credentials
<<: *database-credentials
<<: *redis-credentials
<<: *rabbitmq-credentials
RASA_TOKEN: ${RASA_TOKEN}
RASA_MODEL_PULL_INTERVAL: 10
RABBITMQ_QUEUE: "rasa_production_events"
RASA_TELEMETRY_ENABLED: ${RASA_TELEMETRY_ENABLED:-true}
x-rasa-services: &default-rasa-service
restart: on-failure:5
image: "sysang/rasaserver"
build:
context: "./botserver-app"
args:
RASA_IMAGE: ${RASA_IMAGE}
expose:
- "5005"
command: >
x
--no-prompt
--production
--config-endpoint http://rasa-x:5002/api/config?token=${RASA_X_TOKEN}
--port 5005
--jwt-method HS256
--jwt-secret "${JWT_SECRET}"
--auth-token '${RASA_TOKEN}'
--cors "*"
-vv
depends_on:
- rasa-x
- rabbit
- redis
services:
rasa-x:
restart: on-failure:5
image: "${RASA_X_IMAGE}"
expose:
- "5002"
volumes:
- ./botserver-app/models:/app/models
- ./botserver-app/environments.yml:/app/environments.yml
- ./botserver-app/credentials.yml:/app/credentials.yml
- ./botserver-app/endpoints.yml:/app/endpoints.yml
# - ./botserver-app/logs:/logs
# - ./botserver-app/auth:/app/auth
environment:
<<: *database-credentials
<<: *rasa-credentials
SELF_PORT: "5002"
RASA_MODEL_DIR: "/app/models"
DB_DATABASE: "${DB_DATABASE}"
PASSWORD_SALT: ${PASSWORD_SALT}
RABBITMQ_QUEUE: "rasa_production_events"
RASA_X_USER_ANALYTICS: "0"
SANIC_RESPONSE_TIMEOUT: "3600"
RUN_DATABASE_MIGRATION_AS_SEPARATE_SERVICE: "true"
depends_on:
- db
db-migration:
entrypoint: ["python"]
command: ["-m", "rasax.community.services.db_migration_service"]
restart: on-failure:5
image: "${RASA_X_IMAGE}"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/health || kill 1"]
interval: 5s
timeout: 1s
retries: 3
start_period: 2s
expose:
- "8000"
environment:
<<: *database-credentials
DB_DATABASE: "${DB_DATABASE}"
RUN_DATABASE_MIGRATION_AS_SEPARATE_SERVICE: "true"
MPLCONFIGDIR: "/tmp/.matplotlib"
depends_on:
- db
rasa-production:
<<: *default-rasa-service
volumes:
- ./botserver-app/addons:/app/addons
environment:
<<: *rasa-credentials
RASA_ENVIRONMENT: "production"
DB_DATABASE: "tracker"
MPLCONFIGDIR: "/tmp/.matplotlib"
RASA_MODEL_SERVER: "http://rasa-x:5002/api/projects/default/models/tags/production"
# rasa-worker:
# <<: *default-rasa-service
# volumes:
# - ./botserver-app/addons:/app/addons
# environment:
# <<: *rasa-credentials
# RASA_ENVIRONMENT: "worker"
# DB_DATABASE: "worker_tracker"
# MPLCONFIGDIR: "/tmp/.matplotlib"
# RASA_MODEL_SERVER: "http://rasa-x:5002/api/projects/default/models/tags/production"
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: all
# capabilities: [gpu]
# volumes:
# - ./botserver-app/data:/app/data/
# - ./botserver-app/models:/app/models/
# - ./botserver-app/domain.yml:/app/domain.yml
# - ./botserver-app/config.yml:/app/config.yml
action-server:
restart: on-failure:5
image: "sysang/actionserver"
build:
context: "./botserver-action"
args:
RASA_SDK_IMAGE: ${RASA_SDK_IMAGE}
volumes:
- ./botserver-action/:/app/actions/
expose:
- "5055"
environment:
<<: *duckling-credentials
<<: *redis-credentials
depends_on:
- redis
db:
restart: on-failure:5
image: "bitnami/postgresql:11.9.0"
ports:
- "54321:5432"
environment:
POSTGRESQL_USERNAME: "${DB_USER}"
POSTGRESQL_PASSWORD: "${DB_PASSWORD}"
POSTGRESQL_DATABASE: "${DB_DATABASE}"
volumes:
- ./mounts/db:/bitnami/postgresql
rabbit:
restart: on-failure:5
image: "bitnami/rabbitmq:3.8.14"
environment:
RABBITMQ_HOST: "rabbit"
RABBITMQ_USERNAME: "user"
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
RABBITMQ_DISK_FREE_LIMIT: "{mem_relative, 0.1}"
expose:
- "5672"
duckling:
restart: on-failure:5
image: "rasa/duckling:0.1.6.5-r0"
expose:
- "8000"
command: ["duckling-example-exe", "--no-access-log", "--no-error-log"]
nginx:
restart: on-failure:5
image: "sysang/httpserver"
build:
context: "./httpserver-nginx"
ports:
- "80:8080"
- "443:8443"
volumes:
- ./httpserver-nginx/certbot:/etc/certbot
- ./httpserver-nginx/certs:/etc/certs
- ./httpserver-nginx/nginx-config-files/nginx.conf:/etc/nginx/nginx.conf
- ./httpserver-nginx/nginx-config-files/ssl.conf.template:/etc/nginx/templates/ssl.conf.template
- ./httpserver-nginx/nginx-config-files/${RASAX_NGINX_TEMPLATE_FILE}:/etc/nginx/templates/rasax.nginx.template
- ./httpserver-nginx/nginx-config-files/${CHATWOOT_NGINX_TEMPLATE_FILE}:/etc/nginx/templates/chatwoot.nginx.template
- ./httpserver-nginx/nginx-config-files/chatwoot.ssl.conf.template:/etc/nginx/templates/chatwoot.ssl.conf.template
- ./botfrontend/static:/var/static
environment:
<<: *nginx-host-variables
depends_on:
- rasa-x
- rasa-production
- botfrontend
redis:
restart: on-failure:5
image: "bitnami/redis:6.2.1"
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD}
expose:
- "6379"
botfrontend:
restart: on-failure:5
image: "sysang/botfrontend"
build:
context: "./botfrontend"
environment:
POSTGRESQL_USERNAME: "${POSTGRES_FRONT_USER}"
POSTGRESQL_PASSWORD: "${POSTGRES_FRONT_PASSWORD}"
POSTGRESQL_DATABASE: "${POSTGRES_FRONT_DB}"
POSTGRESQL_HOST: "frontdb"
POSTGRESQL_PORT: 5432
volumes:
- ./botfrontend/:/usr/src/app/
expose:
- "8000"
depends_on:
- frontdb
frontdb:
restart: on-failure:5
image: "bitnami/postgresql:11.9.0"
ports:
- "54323:5432"
environment:
POSTGRESQL_USERNAME: "${POSTGRES_FRONT_USER}"
POSTGRESQL_PASSWORD: "${POSTGRES_FRONT_PASSWORD}"
POSTGRESQL_DATABASE: "${POSTGRES_FRONT_DB}"
volumes:
- ./mounts/frontdb:/bitnami/postgresql
cwbase: &cwbase
image: chatwoot/chatwoot:v2.8.1-ce
env_file: .cw.env
volumes:
- ./mounts/cw/storage:/app/storage
tty: true
stdin_open: true
rails:
<<: *cwbase
depends_on:
- cwdb
- redis
# ports:
# - '3000:3000'
expose:
- "3000"
environment:
- NODE_ENV=production
- RAILS_ENV=production
- INSTALLATION_ENV=docker
entrypoint: docker/entrypoints/rails.sh
# command: ['bundle', 'exec', 'rails', 's', '-p', '3000', '-b', '127.0.0.1']
command: ['bundle', 'exec', 'rails', 's', '-p', '3000']
sidekiq:
<<: *cwbase
depends_on:
- cwdb
- redis
environment:
- NODE_ENV=production
- RAILS_ENV=production
- INSTALLATION_ENV=docker
command: ['bundle', 'exec', 'sidekiq', '-C', 'config/sidekiq.yml']
cwdb:
restart: on-failure:5
image: "bitnami/postgresql:11.9.0"
ports:
- "54322:5432"
environment:
POSTGRESQL_USERNAME: "${POSTGRES_CWUSER}"
POSTGRESQL_PASSWORD: "${POSTGRES_CWPASSWORD}"
POSTGRESQL_DATABASE: "${POSTGRES_CWDB}"
volumes:
- ./mounts/cwdb:/bitnami/postgresql