-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
267 lines (246 loc) · 7.83 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
version: "3.7"
# Using base extension fields to avoid extra repetition
# See https://docs.docker.com/compose/compose-file/#extension-fields for details
x-base-build: &base-build
context: .
dockerfile: service.dockerfile
x-base-command: &base-command sh -c "npm run start:dockerized"
x-base-kafka-command: &base-kafka-command sh -c "./wait-for-it.sh $$KAFKA -t 120 -- npm run start:dockerized"
x-influx-token-volume: &influx-token-volume
type: volume
source: influxdbtoken
target: &volume-target /mnt/compose_volume
volume:
nocopy: true
x-base-environment: &base-environment
KAFKA: kafka:9093
REDIS_HOST: redis
GRAPH_HOST: graph-service
GRAPH_PORT: "4000"
DOCKER_INFLUXDB_INIT_ORG: nosy-cat
DOCKER_INFLUXDB_INIT_BUCKET: default
INFLUX_TOKEN_FILEPATH: &influx-token-filepath /mnt/compose_volume/influxdb-token.json
ACCEPTED_STD_DEVIATIONS: 2
############
# SERVICES #
############
services:
ingress:
build:
<<: *base-build
args:
- SERVICE=ingress
ports:
- "3000:3000"
volumes:
- "./nodemon.json:/project/nodemon.json"
- "./helpers/tsconfig.json:/project/helpers/tsconfig.json"
- "./helpers/declarations:/project/helpers/declarations"
- "./helpers/src:/project/helpers/src"
- "./ingress/tsconfig.json:/project/app/tsconfig.json"
- "./ingress/src:/project/app/src"
depends_on:
- kafka
command: *base-kafka-command
environment: *base-environment
restart: always
dependency-detector:
build:
<<: *base-build
args:
- SERVICE=dependency-detector
volumes:
- "./nodemon.json:/project/nodemon.json"
- "./helpers/tsconfig.json:/project/helpers/tsconfig.json"
- "./helpers/declarations:/project/helpers/declarations"
- "./helpers/src:/project/helpers/src"
- "./dependency-detector/tsconfig.json:/project/app/tsconfig.json"
- "./dependency-detector/src:/project/app/src"
command: *base-kafka-command
depends_on:
- graph-service
- kafka
environment: *base-environment
restart: always
metrics-processor:
build:
<<: *base-build
args:
- SERVICE=metrics-processor
volumes:
- "./nodemon.json:/project/nodemon.json"
- "./helpers/tsconfig.json:/project/helpers/tsconfig.json"
- "./helpers/declarations:/project/helpers/declarations"
- "./helpers/src:/project/helpers/src"
- "./metrics-processor/tsconfig.json:/project/app/tsconfig.json"
- "./metrics-processor/src:/project/app/src"
- *influx-token-volume
command: *base-kafka-command
depends_on:
- kafka
- redis
- volume_init
- influxdb
environment:
<<: *base-environment
INFLUX_FLUSH_INTERVAL_MS: 2000
TIME_UNIT_IN_MS: 2000
USE_INFLUX: "true"
INFLUX_URL: http://influxdb:8086
LOG_LEVEL: info
GAMMA: 0.005
restart: always
anomaly-detector:
build:
<<: *base-build
args:
- SERVICE=anomaly-detector
volumes:
- "./nodemon.json:/project/nodemon.json"
- "./helpers/tsconfig.json:/project/helpers/tsconfig.json"
- "./helpers/declarations:/project/helpers/declarations"
- "./helpers/src:/project/helpers/src"
- "./anomaly-detector/tsconfig.json:/project/app/tsconfig.json"
- "./anomaly-detector/src:/project/app/src"
command: *base-kafka-command
depends_on:
- graph-service
- kafka
environment:
<<: *base-environment
restart: always
graph-service:
build:
<<: *base-build
args:
- SERVICE=graph-service
ports:
- "4000:4000"
volumes:
- "./nodemon.json:/project/nodemon.json"
- "./helpers/tsconfig.json:/project/helpers/tsconfig.json"
- "./helpers/declarations:/project/helpers/declarations"
- "./helpers/src:/project/helpers/src"
- "./graph-service/tsconfig.json:/project/app/tsconfig.json"
- "./graph-service/jest.config.js:/project/app/jest.config.js"
- "./graph-service/src:/project/app/src"
command: sh -c "./wait-for-it.sh $$NEO4J_STATUS -t 120 -- npm run start:dockerized"
depends_on:
- redis
- neo4j
environment:
<<: *base-environment
NEO4J_HOST: neo4j://neo4j:7687
NEO4J_STATUS: http://neo4j:7474
TRANSITIONING_THRESHOLD: 3
INITIALIZING_THRESHOLD: 1
restart: always
neo4j:
image: bitnami/neo4j:4.1.3
ports:
- "7474:7474" # http
- "7473:7473" # https
- "7687:7687" # bolt
## Uncomment the following lines to enable data persistence
# volumes:
# - "./graph-data:/bitnami"
environment:
##########
# WARNING: To have Neo4J Browser running on host communicate with neo4j properly, edit /etc/hosts on
# your machine and make the domain "neo4j" map to "127.0.0.1"
# Docs on how to edit that file (macOS): https://www.inmotionhosting.com/support/website/software/how-to-edit-your-hosts-file-on-a-mac/
##########
# Advertise domain instead of ip so that calls from other containers and the host machine do a different
# dns resolution (docker container ip for other containers, localhost for browser as the ports are exposed)
NEO4J_HOST: "neo4j"
restart: always
volumes:
- "neo4jstorage:/bitnami"
pagerduty-integration:
build:
<<: *base-build
args:
- SERVICE=pagerduty-integration
volumes:
- "./nodemon.json:/project/nodemon.json"
- "./helpers/tsconfig.json:/project/helpers/tsconfig.json"
- "./helpers/declarations:/project/helpers/declarations"
- "./helpers/src:/project/helpers/src"
- "./pagerduty-integration/tsconfig.json:/project/app/tsconfig.json"
- "./pagerduty-integration/src:/project/app/src"
command: *base-kafka-command
restart: always
depends_on:
- kafka
environment:
<<: *base-environment
zookeeper:
image: wurstmeister/zookeeper
restart: always
expose:
- "2181"
kafka:
image: wurstmeister/kafka
depends_on:
- zookeeper
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092
KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_BROKER_ID: 1
restart: always
kowl:
image: quay.io/cloudhut/kowl:v1.1.0
volumes:
- ./kowl.yml:/etc/kowl/config.yaml
ports:
- "8089:8080"
entrypoint: ./kowl --config.filepath=/etc/kowl/config.yaml
depends_on:
- kafka
redis:
image: redis
ports:
- 6379:6379
redis-cli:
image: redis
depends_on:
- redis
command: redis-cli -h redis
influxdb:
image: influxdb:2.0
environment:
<<: *base-environment
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: nosy-cat
DOCKER_INFLUXDB_INIT_PASSWORD: tobi&joni
STARTUP_SCRIPT_LOGFILE: /home/influxdb/setup.log # Must be writable by influxdb user
volumes:
- *influx-token-volume
- "./influxdb/setup.sh:/docker-entrypoint-initdb.d/setup.sh"
- "./influxdb/template.yml:/home/influxdb/template.yml"
# - "influxdbstorage:/var/lib/influxdb2"
restart: always
ports:
- "8086:8086"
depends_on:
- volume_init
volume_init:
# This service is just a hack to make the named volume not just root-only.
# See https://github.com/docker/compose/issues/3270#issuecomment-537763768
image: alpine
environment:
VOLUME_TARGET: *volume-target
command: /bin/sh -c "chown -v nobody:nogroup $$VOLUME_TARGET && chmod -v 777 $$VOLUME_TARGET"
container_name: volume_init
restart: "no"
volumes:
- *influx-token-volume
volumes:
influxdbtoken:
influxdbstorage:
neo4jstorage: