-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
419 lines (385 loc) · 11.7 KB
/
compose.yaml
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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
services:
web:
container_name: template-service-java-springboot-web
hostname: template-service-java-springboot-web
image: template-service-java-springboot
stdin_open: true
tty: true
build:
context: .
dockerfile: Dockerfile
args:
END: 'TEST'
volumes:
- "/tmp:/tmp"
ports:
- '8080:8080'
- '8009:8009'
restart: 'on-failure'
depends_on:
- db
- kafka
logging:
driver: fluentd
options:
fluentd-address: "localhost:24224"
fluentd-async-connect: "true"
tag: 'web-containerssh.{{.ID}}'
environment:
- SLEEP_LENGTH=5
- spring.datasource.url=jdbc:mysql://db:3306/template-service-java-springboot?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false&autoReconnect=true&allowPublicKeyRetrieval=true&createDatabaseIfNotExist=true
- spring.datasource.username=test
- spring.datasource.password=root1234
- spring.kafka.bootstrap-servers=kafka:9092
- spring.security.oauth2.client.registration.template-service-spring-boot.client-id=template-service-spring-boot
- spring.security.oauth2.client.registration.template-service-spring-boot.authorization-grant-type=authorization_code
- spring.security.oauth2.client.registration.template-service-spring-boot.scope=openid, profile, roles
- spring.security.oauth2.client.provider.template-service-spring-boot.issuer-uri=http://localhost:8180/realms/template-service-spring-boot
- spring.security.oauth2.client.provider.template-service-spring-boot.user-name-attribute=test
- spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:8180/realms/template-service-spring-boot
- spring.security.oauth2.client.registration.template-service-spring-boot.client-secret=ABgvt5rZ96furvxhTWTQPPXWh03l4ymF
- spring.security.oauth2.client.registration.template-service-spring-boot.redirect-uri=http://localhost:8080/login/oauth2/code/template-service-spring-boot
- service.module=web
- AWS_REGION=ap-south-1
- AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- AWS_ENDPOINT_URL=http://localhost:4566
- AWS_ENDPOINT_URL_SNS=http://localhost:4566
- OPENAI_API_KEY=$OPENAI_API_KEY
- NEWRELIC_API_KEY=$NEWRELIC_API_KEY
worker:
container_name: template-service-java-springboot-worker
hostname: template-service-java-springboot-worker
image: template-service-java-springboot
stdin_open: true
tty: true
build:
context: .
dockerfile: Dockerfile
args:
END: 'TEST'
volumes:
- "/tmp:/tmp"
ports:
- '8081:8080'
- '8010:8009'
restart: 'on-failure'
depends_on:
- db
- kafka
logging:
driver: fluentd
options:
fluentd-address: "localhost:24224"
fluentd-async-connect: "true"
tag: 'web-containerssh.{{.ID}}'
environment:
- SLEEP_LENGTH=5
- spring.datasource.url=jdbc:mysql://db:3306/template-service-java-springboot?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false&autoReconnect=true&allowPublicKeyRetrieval=true&createDatabaseIfNotExist=true
- spring.datasource.username=test
- spring.datasource.password=root1234
- spring.kafka.bootstrap-servers=kafka:9092
- service.module=worker
- AWS_REGION=ap-south-1
- AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
- AWS_ENDPOINT_URL=http://localstack:4566
- AWS_ENDPOINT_URL_SQS=http://localhost:4566
- AWS_ENDPOINT_URL_SNS=http://localhost:4566
- OPENAI_API_KEY=$OPENAI_API_KEY
- NEWRELIC_API_KEY=$NEWRELIC_API_KEY
sonar:
image: sonarqube:7.9.5-community
container_name: sonar
depends_on:
- sonar-db
- init
environment:
SONAR_JDBC_URL: jdbc:postgresql://sonar-db:5433/sonar
SONAR_JDBC_USERNAME: sonartest
SONAR_JDBC_PASSWORD: sonartest
sonar.web.port: 9000
volumes:
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_logs:/opt/sonarqube/logs
- sonarqube_temp:/opt/sonarqube/temp
ulimits:
nproc: 131072
nofile:
soft: 8192
hard: 131072
ports:
- "9017:9000"
init:
image: bash
container_name: init
privileged: true
user: root
volumes:
- ./sonarqube/init.sh:/mnt/init.sh
command: [ "sh", "-e", "/mnt/init.sh" ]
sonar-db:
image: postgres:14.4
container_name: sonar-db
environment:
POSTGRES_USER: sonartest
POSTGRES_PASSWORD: sonartest
volumes:
- sonar_postgresql:/var/lib/postgresql
- sonar_postgresql_data:/var/lib/postgresql/data
ports:
- '5433:5432'
db:
image: 'mysql:latest'
container_name: db
command: --slow-query-log=on --slow-query-log-file=/var/log/mysql/slow.log
environment:
- 'MYSQL_DATABASE=template-service-java-springboot'
- 'MYSQL_PASSWORD=root1234'
- 'MYSQL_ROOT_PASSWORD=root1234'
- 'MYSQL_USER=test'
ports:
- '3306:3306'
fluentbit:
image: 'shubham01/fluentbit:latest'
container_name: fluentbit
hostname: fluentbit
ports:
- "24224:24224"
- "24224:24224/udp"
volumes:
- ./fluentbit/fluent-bit.conf.temp:/fluent-bit/etc/fluent-bit.conf.temp
- ./fluentbit/parsers.conf:/fluent-bit/etc/parsers.conf
- ./log/:/etc/data
newrelic:
image: 'newrelic:latest'
container_name: newrelic
build:
context: .
dockerfile: ./newrelic-infra/newrelic-infra.dockerfile
cap_add:
- SYS_PTRACE
network_mode: host
pid: host
privileged: true
volumes:
- "/:/host:ro"
- "./newrelic-infra/execute.sh:/tmp/execute.sh"
- "./newrelic-infra/newrelic-infra.yml:/etc/newrelic-infra.yml"
- "/var/run/docker.sock:/var/run/docker.sock"
restart: unless-stopped
environment:
- NEWRELIC_API_KEY=$NEWRELIC_API_KEY
keycloak:
image: 'keycloak/keycloak:22.0'
container_name: keycloak
command: [ 'start-dev' ]
depends_on:
- keycloak-db
environment:
JAVA_OPTS_APPEND: -Dkeycloak.profile.feature.upload_scripts=enabled
TZ: '...'
DB: postgres
DB_URL: jdbc:postgresql://keycloak-db:5432/keycloak?user=postgres
DB_PASSWORD: postgres
LOG_LEVEL: warn
HOSTNAME: localhost
# KC_HOSTNAME: localhost
KC_HOSTNAME_PORT: 8180
KC_HOSTNAME_URL: http://127.0.0.1:8180
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: password
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://keycloak-db:5432/keycloak?user=postgres
KC_DB_USERNAME: postgres
KC_DB_PASSWORD: postgres
KC_DB_ADDR: localhost
KC_DB_DATABASE: keycloak
KC_HEALTH_ENABLED: 'true'
KC_HTTP_ENABLED: 'true'
KC_METRICS_ENABLED: 'true'
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: password
KC_LOG_LEVEL: info
ports:
- "8180:8080"
- "8787:8787" # debug port
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/health/ready" ]
interval: 15s
timeout: 2s
retries: 15
pgadmin:
container_name: pgadmin
image: "dpage/pgadmin4:5.1"
environment:
PGADMIN_DEFAULT_EMAIL: postgres@domain.local
PGADMIN_DEFAULT_PASSWORD: postgres
ports:
- "5050:80"
keycloak-db:
container_name: keycloak-db
image: "postgres:14.4"
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "root" ]
timeout: 45s
interval: 10s
retries: 10
volumes:
- keycloak_postgresql:/var/lib/postgresql
- keycloak_postgresql_data:/var/lib/postgresql/data
# - ./sql:/docker-entrypoint-initdb.d/:ro # turn it on, if you need run init DB
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: keycloak
POSTGRES_HOST: postgres
ports:
- "5432:5432"
zookeeper:
container_name: zookeeper
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- 22181:2181
logging:
driver: fluentd
options:
fluentd-address: "localhost:24224"
fluentd-async-connect: "true"
tag: 'zookeeper-containerssh.{{.ID}}'
kafka:
container_name: kafka
image: confluentinc/cp-kafka:latest
depends_on:
- zookeeper
ports:
- 9092:9092
- 29092:29092
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
logging:
driver: fluentd
options:
fluentd-address: "localhost:24224"
fluentd-async-connect: "true"
tag: 'kafka-containerssh.{{.ID}}'
kafdrop:
container_name: kafdrop
image: obsidiandynamics/kafdrop
restart: "no"
ports:
- "9000:9000"
environment:
KAFKA_BROKERCONNECT: "kafka:9092"
JVM_OPTS: "-Xms16M -Xmx48M -Xss256K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify"
depends_on:
- "kafka"
logging:
driver: fluentd
options:
fluentd-address: "localhost:24224"
fluentd-async-connect: "true"
tag: 'kafdrop-containerssh.{{.ID}}'
prometheus:
image: prom/prometheus:v2.44.0
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
grafana:
image: grafana/grafana
container_name: grafana-server
restart: always
depends_on:
- prometheus
- influxdb
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_INSTALL_PLUGINS=
links:
- influxdb
ports:
- '3000:3000'
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
elasticsearch:
container_name: elasticsearch
image: elasticsearch:8.9.1
ports:
- "9200:9200"
- "9300:9300"
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- discovery.type=single-node
logging:
driver: fluentd
options:
fluentd-address: "localhost:24224"
fluentd-async-connect: "true"
tag: 'elasticsearch-containerssh.{{.ID}}'
telegraf:
image: telegraf
container_name: telegraf
restart: always
volumes:
- ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
depends_on:
- influxdb
- elasticsearch
links:
- influxdb
ports:
- '8125:8125'
influxdb:
image: influxdb:1.8-alpine
container_name: influxdb
restart: always
environment:
- INFLUXDB_DB=influx
- INFLUXDB_ADMIN_USER=admin
- INFLUXDB_ADMIN_PASSWORD=admin
ports:
- '8086:8086'
volumes:
- influxdb_data:/var/lib/influxdb
localstack:
image: localstack/localstack
container_name: localstack
ports:
- "4566:4566"
- "4571:4571"
- "8055:8080"
environment:
- SERVICES=sqs,sns
- AWS_DEFAULT_REGION=ap-south-1
- DEBUG=1
volumes:
- "./localstack/data:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
- ./localstack/setup.sh:/etc/localstack/init/ready.d/script.sh
volumes:
grafana_data: { }
influxdb_data: { }
sonarqube_data:
sonarqube_extensions:
sonarqube_logs:
sonarqube_temp:
sonar_postgresql:
sonar_postgresql_data:
keycloak_postgresql:
keycloak_postgresql_data:
networks:
template-service-java-springboot:
external: true