This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
generated from Ed-Fi-Exchange-OSS/Template-for-GitHub
-
Notifications
You must be signed in to change notification settings - Fork 13
/
docker-compose.yml
314 lines (295 loc) · 10.3 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
# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.
version: '3.8'
services:
# Meadowlark API
meadowlark-api-ml-local-1:
image: meadowlark-api
build: ./
container_name: meadowlark-api-ml-local-1
hostname: meadowlark-api-ml-local-1
ports:
- 3001:3000
environment: &ML_ENV
OAUTH_SIGNING_KEY: ${OAUTH_SIGNING_KEY}
# Next three settings should not be used as such in production environment
OAUTH_HARD_CODED_CREDENTIALS_ENABLED: ${OAUTH_HARD_CODED_CREDENTIALS_ENABLED:-true}
OWN_OAUTH_CLIENT_ID_FOR_CLIENT_AUTH: ${OWN_OAUTH_CLIENT_ID_FOR_CLIENT_AUTH:-meadowlark_verify-only_key_1}
OWN_OAUTH_CLIENT_SECRET_FOR_CLIENT_AUTH: ${OWN_OAUTH_CLIENT_SECRET_FOR_CLIENT_AUTH:-meadowlark_verify-only_secret_1}
OAUTH_SERVER_ENDPOINT_FOR_OWN_TOKEN_REQUEST: ${OAUTH_SERVER_ENDPOINT_FOR_OWN_TOKEN_REQUEST:-http://localhost:3000/local/oauth/token}
OAUTH_SERVER_ENDPOINT_FOR_TOKEN_VERIFICATION: ${OAUTH_SERVER_ENDPOINT_FOR_TOKEN_VERIFICATION:-http://localhost:3000/local/oauth/verify}
OPENSEARCH_USERNAME: ${OPENSEARCH_USERNAME:-admin}
OPENSEARCH_PASSWORD: ${OPENSEARCH_PASS:-admin}
OPENSEARCH_ENDPOINT: ${OPENSEARCH_ENDPOINT:-http://opensearch:9200}
DOCUMENT_STORE_PLUGIN: "${DOCUMENT_STORE_PLUGIN:-@edfi/meadowlark-mongodb-backend}"
QUERY_HANDLER_PLUGIN: "${QUERY_HANDLER_PLUGIN:-@edfi/meadowlark-opensearch-backend}"
LISTENER1_PLUGIN: "${LISTENER1_PLUGIN:-@edfi/meadowlark-opensearch-backend}"
MONGO_URI: ${MONGO_URI}
FASTIFY_RATE_LIMIT: ${FASTIFY_RATE_LIMIT:-false}
FASTIFY_PORT: ${FASTIFY_PORT:-3000}
FASTIFY_NUM_THREADS: ${FASTIFY_NUM_THREADS:-10}
MEADOWLARK_STAGE: ${MEADOWLARK_STAGE:-local}
LOG_LEVEL: ${LOG_LEVEL:-info}
LOG_PRETTY_PRINT: ${LOG_PRETTY_PRINT:-false}
AUTHORIZATION_STORE_PLUGIN: "${AUTHORIZATION_STORE_PLUGIN:-@edfi/meadowlark-mongodb-backend}"
BEGIN_ALLOWED_SCHOOL_YEAR: ${BEGIN_ALLOWED_SCHOOL_YEAR:-2022}
END_ALLOWED_SCHOOL_YEAR: ${END_ALLOWED_SCHOOL_YEAR:-2034}
ALLOW_TYPE_COERCION: ${ALLOW_TYPE_COERCION:-true}
ALLOW__EXT_PROPERTY: ${ALLOW__EXT_PROPERTY:-true}
ALLOW_OVERPOSTING: ${ALLOW_OVERPOSTING:-false}
MEADOWLARK_DATABASE_NAME: ${MEADOWLARK_DATABASE_NAME:-meadowlark}
POSTGRES_HOST: ${POSTGRES_HOST:-postgres}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-abcdefgh1!}
LOG_TO_FILE: ${LOG_TO_FILE:-true}
LOG_FILE_LOCATION: ${LOG_FILE_LOCATION:-/var/log/}
restart: unless-stopped
healthcheck: &ML_HEALTH
test: curl -s http://localhost:3000/local >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 50
meadowlark-api-ml-local-2:
image: meadowlark-api
build: ./
container_name: meadowlark-api-ml-local-2
hostname: meadowlark-api-ml-local-2
environment:
*ML_ENV
restart: unless-stopped
healthcheck:
*ML_HEALTH
meadowlark-api-ml-local-3:
image: meadowlark-api
build: ./
container_name: meadowlark-api-ml-local-3
hostname: meadowlark-api-ml-local-3
environment:
*ML_ENV
restart: unless-stopped
healthcheck:
*ML_HEALTH
meadowlark-oauth-ml-local-1:
image: meadowlark-api
build: ./
container_name: meadowlark-oauth-ml-local-1
hostname: meadowlark-oauth-ml-local-1
environment:
*ML_ENV
restart: unless-stopped
healthcheck:
*ML_HEALTH
meadowlark-oauth-ml-local-2:
image: meadowlark-api
build: ./
container_name: meadowlark-oauth-ml-local-2
hostname: meadowlark-oauth-ml-local-2
environment:
*ML_ENV
restart: unless-stopped
healthcheck:
*ML_HEALTH
# OpenSearch backend
opensearch-ml-local:
image: opensearchproject/opensearch:2.7.0@sha256:55f1f67e7d3645aa838b63a589bce5645154ba275814e52d4638d371ca0f8cb5
container_name: opensearch-ml-local-node1
hostname: opensearch
environment:
cluster.name: opensearch-cluster-ml-local
bootstrap.memory_lock: "true" # along with the memlock settings below, disables swapping
OPENSEARCH_JAVA_OPTS: -Xms512m -Xmx512m # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
discovery.type: single-node
DISABLE_INSTALL_DEMO_CONFIG: "true" # disables execution of install_demo_configuration.sh bundled with security plugin, which installs demo certificates and security configurations to OpenSearch
DISABLE_SECURITY_PLUGIN: "true" # disables security plugin entirely in OpenSearch by setting plugins.security.disabled: true in opensearch.yml
mem_limit: 2g
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems
hard: 65536
volumes:
- opensearch-ml-local-data:/usr/share/opensearch/data
ports:
- 9201:9200
- 9601:9600 # required for Performance Analyzer
restart: unless-stopped
healthcheck:
test: curl -s http://localhost:9200/_cat/health >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 50
opensearch-dashboards:
image: opensearchproject/opensearch-dashboards:2.7.0@sha256:b08ba384fd2751fcccb95da4d65b0444694e4df4bf3079251ef9c7dfe6044a85
container_name: opensearch-dashboards-ml-local
ports:
- 5602:5601
environment:
OPENSEARCH_HOSTS: '["http://opensearch-ml-local-node1:9200"]'
DISABLE_SECURITY_DASHBOARDS_PLUGIN: true # disables security dashboards plugin in OpenSearch Dashboards
restart: unless-stopped
# Primary MongoDB node
mongo1:
image: edfi-mongo:4.0.28
container_name: mongo1-ml-local
hostname: mongo1
ports:
- 27027:27017
restart: unless-stopped
environment:
# These two only needed on mongo1
ADMIN_USERNAME: ${MONGODB_USER:-mongo}
ADMIN_PASSWORD: ${MONGODB_PASS:-abcdefgh1!}
healthcheck: &mongohealth
test: echo 'db.runCommand({serverStatus:1}).ok' | mongo admin -u ${MONGODB_USER:-mongo} -p ${MONGODB_PASS:-abcdefgh1!} --quiet | grep 1
interval: 10s
timeout: 10s
retries: 3
# Wait a bit for first time startup to complete
start_period: 40s
command: [ "/usr/local/bin/start-node1.sh" ]
volumes:
- mongo-ml-local-data1:/data/db
- mongo-ml-local-log1:/var/log/mongodb
- mongo-ml-local-auth:/auth
# Secondary MongoDB node
mongo2:
image: edfi-mongo:4.0.28
container_name: mongo2-ml-local
hostname: mongo2
ports:
- 27028:27017
restart: unless-stopped
healthcheck:
*mongohealth
command: [ "/usr/local/bin/start.sh" ]
volumes:
- mongo-ml-local-data2:/data/db
- mongo-ml-local-log2:/var/log/mongodb
- mongo-ml-local-auth:/auth
# Tertiary MongoDB node
mongo3:
image: edfi-mongo:4.0.28
container_name: mongo3-ml-local
hostname: mongo3
ports:
- 27029:27017
restart: unless-stopped
healthcheck:
*mongohealth
command: [ "/usr/local/bin/start.sh" ]
volumes:
- mongo-ml-local-data3:/data/db
- mongo-ml-local-log3:/var/log/mongodb
- mongo-ml-local-auth:/auth
# postgres:
# image: postgres:14.3-alpine@sha256:84c6ea4333ae18f25ea0fb18bb142156f2a2e545e0a779d93bbf08079e56bdaf
# container_name: postgres-ml
# hostname: postgres
# restart: always
# environment:
# POSTGRES_USER: ${POSTGRES_USER:-postgres}
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-abcdefgh1!}
# ports:
# - ${POSTGRES_PORT:-5432}:5432
# volumes:
# - pgsql-ml-data:/var/lib/postgresql/data
lb:
image: nginx:alpine
volumes:
- ./sample-load-balancer.conf:/etc/nginx/conf.d/default.conf
ports:
- 3000:3000
depends_on:
- meadowlark-api-ml-local-1
- meadowlark-api-ml-local-2
- meadowlark-api-ml-local-3
- meadowlark-oauth-ml-local-1
- meadowlark-oauth-ml-local-2
volumes:
mongo-ml-local-data1:
labels:
edfi-ml: local
mongo-ml-local-log1:
labels:
edfi-ml: local
mongo-ml-local-data2:
labels:
edfi-ml: local
mongo-ml-local-log2:
labels:
edfi-ml: local
mongo-ml-local-data3:
labels:
edfi-ml: local
mongo-ml-local-log3:
labels:
edfi-ml: local
mongo-ml-local-auth:
external: true
opensearch-ml-local-data:
labels:
edfi-ml: local
# pgsql-ml-data:
# driver: local
# zookeeper-ml-local-logs:
# labels:
# edfi-ml: local
# zookeeper-ml-local-data:
# labels:
# edfi-ml: local
# Zookeeper image from Debezium
# zookeeper:
# image: debezium/zookeeper:2.1@sha256:7dc66b2f30ab8365a92558bfe799e678b31948fd266c1a2116bd04a18a8222b0
# container_name: zookeeper1-ml-local
# hostname: zookeeper1
# ports:
# - 2182:2181
# - 2889:2888
# - 3889:3888
# volumes:
# - zookeeper-ml-local-logs:/var/lib/zookeeper/log
# - zookeeper-ml-local-data:/var/lib/zookeeper/data
# # Kafka image from Debezium
# kafka:
# image: debezium/kafka:2.1
# container_name: kafka1-ml-local
# hostname: kafka1
# ports:
# - 9093:9092
# links:
# - zookeeper
# environment:
# - ZOOKEEPER_CONNECT=zookeeper:2181
# # Kafka Connect from Debezium, includes Debezium connectors
# connect:
# image: debezium/connect:2.1@sha256:320f6fd0bd492d54a5d449699652b26f90549cf891d65356bf1e5a2948993bc5
# container_name: kafka-connect-ml-local
# hostname: kafka-connect
# ports:
# - 8084:8083
# links:
# - kafka
# - mongo1
# - mongo2
# - mongo3
# environment:
# - BOOTSTRAP_SERVERS=kafka:9092
# - GROUP_ID=1
# - CONFIG_STORAGE_TOPIC=debezium_config
# - OFFSET_STORAGE_TOPIC=debezium_offset
# - STATUS_STORAGE_TOPIC=debezium_status
# # Kafka Web UI - https://github.com/obsidiandynamics/kafdrop
# kafdrop:
# image: obsidiandynamics/kafdrop:3.30.0@sha256:5337c9e0e2dee204bdde53e90cf97001f44fb9e8c3380340436efa844901a3f4
# container_name: kafdrop-ml-local
# hostname: kafdrop
# ports:
# - 9001:9000
# environment:
# KAFKA_BROKERCONNECT: kafka1:9092
# JVM_OPTS: "-Xms32M -Xmx64M"
# SERVER_SERVLET_CONTEXTPATH: "/"