-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
189 lines (179 loc) · 6.91 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
# Attention:
# Use this docker-compose to:
# - Up development environment: docker-compose up
# - Build docker images: docker-compose build
version: '3.6'
services:
database:
image: postgres
container_name: bothub-db
ports:
- 5432:5432
volumes:
- postgres:/var/lib/postgresql/data
networks:
- default
- bothub
environment:
- POSTGRES_USER=${POSTGRES_USER:-bothub}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-bothub}
- POSTGRES_DB=${POSTGRES_DB:-bothub}
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.role == manager]
bothub:
image: ${DOCKER_IMAGE_NAME:-ilha/bothub}:${TAG:-latest}
container_name: bothub-backend
build:
context: .
dockerfile: Dockerfile
ports:
- ${ENGINE_PORT:-80}:80
networks:
- default
- bothub
environment:
- SECRET_KEY=${SECRET_KEY:-SK}
- DEBUG=${DEBUG:-true}
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-*}
- DEFAULT_DATABASE=${DEFAULT_DATABASE:-postgres://bothub:bothub@database:5432/bothub}
- LANGUAGE_CODE=${LANGUAGE_CODE:-en-us}
- TIME_ZONE=${TIME_ZONE:-UTC}
- EMAIL_HOST=${EMAIL_HOST}
- EMAIL_PORT=${EMAIL_PORT:-25}
- DEFAULT_FROM_EMAIL=${DEFAULT_FROM_EMAIL:-webmaster@localhost}
- SERVER_EMAIL=${SERVER_EMAIL:-root@localhost}
- EMAIL_HOST_USER=${EMAIL_HOST_USER}
- EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD}
- EMAIL_USE_SSL=${EMAIL_USE_SSL:-false}
- EMAIL_USE_TLS=${EMAIL_USE_TLS:-false}
- ADMINS=${ADMINS}
- CSRF_COOKIE_DOMAIN=${CSRF_COOKIE_DOMAIN}
- CSRF_COOKIE_SECURE=${CSRF_COOKIE_SECURE:-false}
- BOTHUB_WEBAPP_BASE_URL=${BOTHUB_WEBAPP_BASE_URL:-http://localhost/}
- BOTHUB_NLP_BASE_URL=${BOTHUB_NLP_BASE_URL:-http://bothub-nlp-api:2657/}
- CHECK_ACCESSIBLE_API_URL=${CHECK_ACCESSIBLE_API_URL}
- SEND_EMAILS=${SEND_EMAILS:-true}
- SUPPORTED_LANGUAGES=${SUPPORTED_LANGUAGES:-en|pt}
- BASE_URL=${BOTHUB_BACKEND_BASE_URL:-https://api.bothub.it}
- BOTHUB_ENGINE_AWS_ACCESS_KEY_ID=${BOTHUB_ENGINE_AWS_ACCESS_KEY_ID}
- BOTHUB_ENGINE_AWS_SECRET_ACCESS_KEY=${BOTHUB_ENGINE_AWS_SECRET_ACCESS_KEY}
- BOTHUB_ENGINE_AWS_S3_BUCKET_NAME=${BOTHUB_ENGINE_AWS_S3_BUCKET_NAME}
- BOTHUB_ENGINE_AWS_REGION_NAME=${BOTHUB_ENGINE_AWS_REGION_NAME}
- BOTHUB_ENGINE_CELERY_BROKER_URL=${BOTHUB_ENGINE_CELERY_BROKER_URL:-redis://bothub-engine-celery-redis:6379/0}
- BOTHUB_ENGINE_CELERY_BACKEND_URL=${BOTHUB_ENGINE_CELERY_BACKEND_URL:-redis://bothub-engine-celery-redis:6379/0}
- RECAPTCHA_SECRET_KEY=${RECAPTCHA_SECRET_KEY}
- ELASTICSEARCH_DSL=${ELASTICSEARCH_DSL:-es:9200}
- ELASTICSEARCH_NUMBER_OF_SHARDS=${ELASTICSEARCH_NUMBER_OF_SHARDS:-1}
- ELASTICSEARCH_NUMBER_OF_REPLICAS=${ELASTICSEARCH_NUMBER_OF_REPLICAS:-0}
- ELASTICSEARCH_REPOSITORYNLPLOG_INDEX=${ELASTICSEARCH_REPOSITORYNLPLOG_INDEX:-ai_repositorynlplog}
- ELASTICSEARCH_REPOSITORYNLPLOG_INDEX=${ELASTICSEARCH_REPOSITORYQANLPLOG_INDEX:-ai_repositoryqanlplog}
- ELASTICSEARCH_SIGNAL_PROCESSOR=${ELASTICSEARCH_SIGNAL_PROCESSOR:-celery}
- RUN_AS_DEVELOPMENT_MODE=${RUN_AS_DEVELOPMENT_MODE:-false}
- TEST_REPOSITORY_ID=${TEST_REPOSITORY_ID}
celery:
build:
context: .
dockerfile: Dockerfile
container_name: bothub-celery
depends_on:
- bothub
- bothub-engine-celery-redis
- database
networks:
- default
- bothub
command: "celery -A bothub worker -l info"
environment:
- SECRET_KEY=${SECRET_KEY:-SK}
- DEBUG=${DEBUG:-true}
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-*}
- DEFAULT_DATABASE=${DEFAULT_DATABASE:-postgres://bothub:bothub@database:5432/bothub}
- LANGUAGE_CODE=${LANGUAGE_CODE:-en-us}
- TIME_ZONE=${TIME_ZONE:-UTC}
- EMAIL_HOST=${EMAIL_HOST}
- EMAIL_PORT=${EMAIL_PORT:-25}
- DEFAULT_FROM_EMAIL=${DEFAULT_FROM_EMAIL:-webmaster@localhost}
- SERVER_EMAIL=${SERVER_EMAIL:-root@localhost}
- EMAIL_HOST_USER=${EMAIL_HOST_USER}
- EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD}
- EMAIL_USE_SSL=${EMAIL_USE_SSL:-false}
- EMAIL_USE_TLS=${EMAIL_USE_TLS:-false}
- ADMINS=${ADMINS}
- CSRF_COOKIE_DOMAIN=${CSRF_COOKIE_DOMAIN}
- CSRF_COOKIE_SECURE=${CSRF_COOKIE_SECURE:-false}
- BOTHUB_WEBAPP_BASE_URL=${BOTHUB_WEBAPP_BASE_URL:-http://localhost/}
- BOTHUB_NLP_BASE_URL=${BOTHUB_NLP_BASE_URL:-http://bothub-nlp-api:2657/}
- CHECK_ACCESSIBLE_API_URL=${CHECK_ACCESSIBLE_API_URL}
- SEND_EMAILS=${SEND_EMAILS:-true}
- SUPPORTED_LANGUAGES=${SUPPORTED_LANGUAGES:-en|pt}
- BOTHUB_ENGINE_CELERY_BROKER_URL=${BOTHUB_ENGINE_CELERY_BROKER_URL:-redis://bothub-engine-celery-redis:6379/0}
- BOTHUB_ENGINE_CELERY_BACKEND_URL=${BOTHUB_ENGINE_CELERY_BACKEND_URL:-redis://bothub-engine-celery-redis:6379/0}
- ELASTICSEARCH_DSL=${ELASTICSEARCH_DSL:-es:9200}
- ELASTICSEARCH_NUMBER_OF_SHARDS=${ELASTICSEARCH_NUMBER_OF_SHARDS:-1}
- ELASTICSEARCH_NUMBER_OF_REPLICAS=${ELASTICSEARCH_NUMBER_OF_REPLICAS:-0}
- ELASTICSEARCH_REPOSITORYNLPLOG_INDEX=${ELASTICSEARCH_REPOSITORYNLPLOG_INDEX:-ai_repositorynlplog}
- ELASTICSEARCH_REPOSITORYQANLPLOG_INDEX=${ELASTICSEARCH_REPOSITORYQANLPLOG_INDEX:-ai_repositoryqanlplog}
- ELASTICSEARCH_REPOSITORYBASICEXAMPLE_INDEX=${ELASTICSEARCH_REPOSITORYBASICEXAMPLE_INDEX:-ai_repositorybasicexample}
- ELASTICSEARCH_ZEROSHOT_INDEX=${ELASTICSEARCH_ZEROSHOT_INDEX:-ai_zeroshot_log}
- ELASTICSEARCH_SIGNAL_PROCESSOR=${ELASTICSEARCH_SIGNAL_PROCESSOR:-celery}
- USE_ELASTICSEARCH=${USE_ELASTICSEARCH:-true}
- ELASTICSEARCH_CUSTOM_QUEUE=${ELASTICSEARCH_CUSTOM_QUEUE:-celery}
- TEST_REPOSITORY_ID=${TEST_REPOSITORY_ID}
bothub-engine-celery-redis:
image: redis
container_name: bothub-redis
ports:
- 6379:6379
es:
image: elasticsearch:7.14.1
container_name: bothub-es
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms128m -Xmx2g"
ulimits:
memlock:
soft: -1
hard: -1
deploy:
mode: replicated
replicas: 1
resources:
limits:
cpus: "2"
memory: 4G
reservations:
cpus: "1"
memory: 2G
ports:
- 9200:9200
networks:
- default
- bothub
kibana:
image: docker.elastic.co/kibana/kibana:7.14.1
container_name: bothub-kibana
environment:
SERVER_NAME: kibana
ELASTICSEARCH_HOSTS: http://es:9200
ports:
- 5601:5601
networks:
- default
- bothub
rabbitmq:
image: rabbitmq:3.9.7-management
ports:
- "5672:5672" # Porta para conexão com o RabbitMQ
- "15672:15672" # Porta para acessar a interface de gerenciamento do RabbitMQ
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
volumes:
postgres:
networks:
bothub:
external: true