-
Notifications
You must be signed in to change notification settings - Fork 202
/
docker-compose.yml
284 lines (254 loc) · 5.55 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
# Main docker-compose
# Suited for containerized SSR server.
version: "2.2"
services:
## WEB SERVER / GATEWAY
nginx:
build:
context: ./containers/nginx
dockerfile: ./Dockerfile.dev-ssr
mem_limit: 512MB
depends_on:
- php-fpm
- php-rr
networks:
- app
ports:
- "8080:80"
environment:
- UPSTREAM_ENDPOINT
volumes:
- ./front/:/var/www/Minds/front:cached
- ./embedded-comments/:/var/www/Minds/embedded-comments
- ./embedded-boosts/:/var/www/Minds/embedded-boosts
## APP ENGINE
php-fpm:
build:
context: ./engine
dockerfile: ./containers/php-fpm/Dockerfile.dev
mem_limit: 512MB
depends_on:
- cassandra
- elasticsearch
- redis
- pulsar
- mysql
networks:
- app
volumes:
- ./front/:/var/www/Minds/front:cached
- ./engine/:/var/www/Minds/engine:cached
- keys:/.dev
php-rr:
build:
context: ./engine
dockerfile: ./containers/php-rr/Dockerfile.dev
mem_limit: 512MB
depends_on:
- cassandra
- elasticsearch
- redis
- pulsar
- mysql
networks:
- app
ports:
- "9001:9001"
- "2112:2112"
volumes:
- ./engine/:/var/www/Minds/engine:cached
- keys:/.dev
runners:
build:
context: ./engine
dockerfile: ./containers/php-runners/Dockerfile
depends_on:
- cassandra
- elasticsearch
- redis
networks:
- app
volumes:
- ./front/:/var/www/Minds/front:cached
- ./engine/:/var/www/Minds/engine:cached
- keys:/.dev
sockets:
build:
context: ./sockets
dockerfile: ./Dockerfile
environment:
- PORT=3000
- REDIS_HOST=redis
- REDIS_PORT=6379
- JWT_SECRET=<!!! set this to jwt-token in your engine/settings.php !!!>
- CASSANDRA_SERVERS=cassandra
- CASSANDRA_KEYSPACE=minds
networks:
- app
depends_on:
- redis
- cassandra
volumes:
- keys:/.dev
ports:
- 3000:3000
## Vault
vault:
image: hashicorp/vault
networks:
- app
environment:
VAULT_ADDR: "http://0.0.0.0:8200"
VAULT_API_ADDR: "http://0.0.0.0:8200"
cap_add:
- IPC_LOCK
ports:
- 8200:8200
volumes:
- vault:/vault/file:rw
entrypoint: vault server -dev -dev-listen-address="0.0.0.0:8200" -dev-root-token-id="root"
## DATABASES
cassandra:
build:
context: ./containers/cassandra
environment:
- CASSANDRA_START_RPC=true
- MAX_HEAP_SIZE=768M
- HEAP_NEWSIZE=512M
networks:
- app
mem_limit: 1024MB
volumes:
- cassandra-data:/var/lib/cassandra
ports:
- 9042:9042
healthcheck:
test: "cqlsh -e 'DESC TABLE system.batches'"
retries: 10
timeout: 5s
interval: 15s
wait-for-cassandra:
build:
context: ./containers/wait-for-cassandra
networks:
- app
depends_on:
- cassandra
elasticsearch:
image: opensearchproject/opensearch:2.17.1
mem_limit: 1G # keep an eye
ulimits:
nproc: 65536
memlock:
soft: 65536
hard: 65536
nofile:
soft: 65536
hard: 65536
environment:
- "ES_JAVA_OPTS=-Xms726m -Xmx726m"
- discovery.type=single-node
- DISABLE_INSTALL_DEMO_CONFIG=true
- plugins.security.disabled=true
- cluster.routing.allocation.disk.watermark.low=95%
- cluster.routing.allocation.disk.watermark.high=99%
- cluster.routing.allocation.disk.watermark.flood_stage=99%
networks:
- app
ports:
- "9200:9200"
volumes:
- opendistro-data:/usr/share/opensearch/data
## CACHE
redis:
image: redis:6.2.7-alpine
mem_limit: 100MB # keep an eye
networks:
- app
ports:
- "6379:6379"
## INSTALLATION ARTIFACTS
installer:
build:
context: ./engine
dockerfile: ./containers/installer/Dockerfile
networks:
- app
volumes:
- ./front/:/var/www/Minds/front:delegated
- ./engine/:/var/www/Minds/engine:delegated
- keys:/.dev
depends_on:
cassandra:
condition: service_healthy
elasticsearch-provisioner:
build:
context: ./containers/elasticsearch-provisioner
networks:
- app
depends_on:
- elasticsearch
## Pulsar
pulsar:
image: apachepulsar/pulsar:2.11.2
entrypoint: bin/pulsar standalone -nss
networks:
- app
ports:
- 6650:6650
- 8088:8080
volumes:
- pulsardata:/pulsar/data
- pulsarconf:/pulsar/conf
## MySQL
mysql:
image: mysql:8.0
networks:
- app
ports:
- 3306:3306
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_USER: "user"
MYSQL_PASSWORD: "changeme"
MYSQL_DATABASE: "minds"
volumes:
- mysql:/var/lib/mysql
mysql-provisioner:
build:
context: ./containers/mysql-provisioner
networks:
- app
depends_on:
- mysql
## METASCRAPER SERVER
metascraper:
image: registry.gitlab.com/minds/developers/metascraper-server
mem_limit: 512MB
networks:
- app
ports:
- "3334:3334"
## UTILITIES
kibana:
image: docker.elastic.co/kibana/kibana-oss:6.6.2
depends_on:
- elasticsearch
environment:
ELASTICSEARCH_URL: http://minds_elasticsearch_1:9200
networks:
- app
ports:
- "5601:5601"
volumes:
cassandra-data:
elasticsearch-data:
opendistro-data:
keys:
pulsardata:
pulsarconf:
mysql:
vault:
networks:
app:
driver: "bridge"