-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
212 lines (198 loc) · 4.45 KB
/
docker-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
services:
gw:
build:
context: gw
dockerfile: ./Dockerfile
image: gw
restart: on-failure
ports:
- "8080:${GATEWAY_PORT}"
depends_on:
- sub
- rw
- mailer
env_file:
- .env
networks:
- converter
sub:
build:
context: sub
dockerfile: ./Dockerfile
image: sub
restart: on-failure
depends_on:
migrate:
condition: service_completed_successfully
rw:
condition: service_started
nats:
condition: service_healthy
env_file:
- .env
networks:
- converter
rw:
build:
context: rw
dockerfile: ./Dockerfile
image: rw
restart: on-failure
env_file:
- .env
networks:
- converter
mailer:
build:
context: mailer
dockerfile: ./Dockerfile
image: mailer
restart: on-failure
depends_on:
nats:
condition: service_healthy
debezium:
condition: service_healthy
mongo:
condition: service_started
env_file:
- .env
networks:
- converter
db:
image: mysql:8.0-debian
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
start_period: 5s
interval: 3s
timeout: 3s
retries: 30
command:
- --log-bin=binlog
- --binlog-format=ROW
- --server-id=1
- --binlog-do-db=${MYSQL_DATABASE}
env_file:
- .env
volumes:
- converterdata:/var/lib/mysql
networks:
- converter
migrate:
image: migrate/migrate
restart: on-failure
depends_on:
db:
condition: service_healthy
env_file:
- .env
networks:
- converter
volumes:
- ./sub/migrations:/database
command: ["-path", "/database", "-database", "mysql://${SUB_DSN}", "up"]
prometheus:
image: prom/prometheus:latest
command:
- --web.enable-remote-write-receiver
- --enable-feature=native-histograms
- --config.file=/etc/prometheus/prometheus.yml
volumes:
- "${PWD}/infra/prometheus.yml:/etc/prometheus/prometheus.yml"
- "${PWD}/infra/rules.yml:/etc/prometheus/rules.yml"
ports:
- "9090:9090"
networks:
- converter
alert-manager:
image: prom/alertmanager
networks:
- converter
ports:
- 9093:9093
volumes:
- ${PWD}/infra/alertmanager.yml:/etc/alertmanager/alertmanager.yml
- ${PWD}/infra/password.txt:/etc/alertmanager/password.txt
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- "--path.procfs=/host/proc"
- "--path.rootfs=/rootfs"
- "--path.sysfs=/host/sys"
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
networks:
- converter
grafana:
image: grafana/grafana:10.1.2
ports:
- "3000:3000"
environment:
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_BASIC_ENABLED=false
volumes:
- ./infra/grafana/dashboard.yaml:/etc/grafana/provisioning/dashboards/main.yaml
- ./infra/grafana/dashboards:/var/lib/grafana/dashboards
- ./infra/grafana/provisioning:/etc/grafana/provisioning
depends_on:
- prometheus
networks:
- converter
nats:
image: nats:2.10.16-alpine3.19
healthcheck:
test: wget http://localhost:8222/healthz -q -S -O -
start_period: 3s
retries: 3
timeout: 3s
interval: 14s
ports:
- 4222:4222
- 8222:8222
command:
- "--debug"
- "--http_port=8222"
- "--jetstream"
networks:
- converter
debezium:
image: docker.io/debezium/server:latest
volumes:
- ./infra/debezium/:/debezium/conf
healthcheck:
test: curl --silent http://localhost:8080/q/health || exit 1
interval: 10s
timeout: 5s
retries: 3
depends_on:
- migrate
- nats
networks:
- converter
mongo:
image: mongo:4.4.6
restart: always
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo mongo:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
env_file:
- .env
networks:
- converter
volumes:
- notifierdata:/data/db
networks:
converter:
driver: bridge
volumes:
converterdata: {}
notifierdata: {}