-
Notifications
You must be signed in to change notification settings - Fork 852
/
Copy pathdocker-compose.yaml
196 lines (196 loc) · 5.61 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
version: '2.1'
services:
jaeger:
image: jaegertracing/all-in-one:1
ports:
- 6831:6831/udp
- 16686:16686
networks:
- my-network
zookeeper:
image: quay.io/debezium/zookeeper:${DEBEZIUM_VERSION}
ports:
- 2181:2181
- 2888:2888
- 3888:3888
networks:
- my-network
kafka:
image: quay.io/debezium/kafka:${DEBEZIUM_VERSION}
ports:
- 9092:9092
links:
- zookeeper
environment:
- ZOOKEEPER_CONNECT=zookeeper:2181
# Set to host IP address when working on the services locally
# - ADVERTISED_HOST_NAME=172.17.0.1
networks:
- my-network
connect:
image: debezium/strimzi-connect
build:
context: debezium-strimzi
ports:
- 8083:8083
links:
- kafka
- order-db
environment:
- KAFKA_LOG4J_OPTS=-Dlog4j.configuration=file:/opt/kafka/config/connect-log4j.properties
- KAFKA_CONNECT_BOOTSTRAP_SERVERS=kafka:9092
- |
KAFKA_CONNECT_CONFIGURATION=
key.converter=org.apache.kafka.connect.json.JsonConverter
value.converter=org.apache.kafka.connect.json.JsonConverter
key.converter.schemas.enable=false
value.converter.schemas.enable=false
group.id=connect
offset.storage.topic=connect-offsets
offset.storage.replication.factor=1
config.storage.topic=connect-configs
config.storage.replication.factor=1
status.storage.topic=connect-status
status.storage.replication.factor=1
consumer.interceptor.classes=io.opentracing.contrib.kafka.TracingConsumerInterceptor
producer.interceptor.classes=io.opentracing.contrib.kafka.TracingProducerInterceptor
- JAEGER_SERVICE_NAME=kafka-connect
- JAEGER_AGENT_HOST=jaeger
- JAEGER_SAMPLER_TYPE=const
- JAEGER_SAMPLER_PARAM=1
- STRIMZI_TRACING=jaeger
command: /opt/kafka/kafka_connect_run.sh
networks:
- my-network
order-db:
image: quay.io/debezium/example-postgres:${DEBEZIUM_VERSION}
ports:
- 5432:5432
healthcheck:
test: "pg_isready -U orderuser -d orderdb"
interval: 2s
timeout: 20s
retries: 10
environment:
- POSTGRES_USER=orderuser
- POSTGRES_PASSWORD=orderpw
- POSTGRES_DB=orderdb
volumes:
- ./init-order.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- my-network
payment-db:
image: quay.io/debezium/example-postgres:${DEBEZIUM_VERSION}
ports:
- 5433:5432
healthcheck:
test: "pg_isready -U paymentuser -d paymentdb"
interval: 2s
timeout: 20s
retries: 10
environment:
- POSTGRES_USER=paymentuser
- POSTGRES_PASSWORD=paymentpw
- POSTGRES_DB=paymentdb
volumes:
- ./init-payment.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- my-network
customer-db:
image: quay.io/debezium/example-postgres:${DEBEZIUM_VERSION}
ports:
- 5434:5432
healthcheck:
test: "pg_isready -U customeruser -d customerdb"
interval: 2s
timeout: 20s
retries: 10
environment:
- POSTGRES_USER=customeruser
- POSTGRES_PASSWORD=customerpw
- POSTGRES_DB=customerdb
volumes:
- ./init-customer.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- my-network
pgadmin:
container_name: pgadmin_container
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
volumes:
- ./servers.json:/pgadmin4/servers.json
ports:
- "${PGADMIN_PORT:-5050}:80"
networks:
- my-network
order-service:
image: debezium-examples/saga-order-service:${DEBEZIUM_VERSION}
build:
context: order-service
dockerfile: src/main/docker/Dockerfile.jvm
ports:
- 8080:8080
links:
- kafka
- order-db
- jaeger
environment:
- QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://order-db:5432/orderdb
- MP_MESSAGING_INCOMING_PAYMENTRESPONSE_BOOTSTRAP_SERVERS=kafka:9092
- MP_MESSAGING_INCOMING_CREDITRESPONSE_BOOTSTRAP_SERVERS=kafka:9092
- JAEGER_SERVICE_NAME=order-service
- JAEGER_SAMPLER_TYPE=const
- JAEGER_SAMPLER_PARAM=1
- JAEGER_AGENT_HOST=jaeger
depends_on:
order-db:
condition: service_healthy
networks:
- my-network
payment-service:
image: debezium-examples/saga-payment-service:${DEBEZIUM_VERSION}
build:
context: payment-service
dockerfile: src/main/docker/Dockerfile.jvm
links:
- kafka
- payment-db
- jaeger
environment:
- QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://payment-db:5432/paymentdb
- MP_MESSAGING_INCOMING_PAYMENT_BOOTSTRAP_SERVERS=kafka:9092
- JAEGER_SERVICE_NAME=payment-service
- JAEGER_SAMPLER_TYPE=const
- JAEGER_SAMPLER_PARAM=1
- JAEGER_AGENT_HOST=jaeger
depends_on:
payment-db:
condition: service_healthy
networks:
- my-network
customer-service:
image: debezium-examples/saga-customer-service:${DEBEZIUM_VERSION}
build:
context: customer-service
dockerfile: src/main/docker/Dockerfile.jvm
links:
- kafka
- customer-db
- jaeger
environment:
- QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://customer-db:5432/customerdb
- MP_MESSAGING_INCOMING_CREDIT_BOOTSTRAP_SERVERS=kafka:9092
- JAEGER_SERVICE_NAME=customer-service
- JAEGER_SAMPLER_TYPE=const
- JAEGER_SAMPLER_PARAM=1
- JAEGER_AGENT_HOST=jaeger
depends_on:
customer-db:
condition: service_healthy
networks:
- my-network
networks:
my-network:
name: saga-network