-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
139 lines (133 loc) · 3.28 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
version: "2"
name: nodejs-outbox
services:
rabbitmq:
build:
context: ./.docker/rabbitmq
dockerfile: Dockerfile
container_name: rabbitmq
ports:
- 5672:5672
- 15672:15672
- 5552:5552
healthcheck:
test: "rabbitmq-diagnostics check_port_connectivity"
interval: 2s
timeout: 20s
retries: 10
environment:
RABBITMQ_DEFAULT_PASS: root
RABBITMQ_DEFAULT_USER: root
order-db:
build:
context: ./.docker/order-db
dockerfile: Dockerfile
container_name: order-db
ports:
- 5432:5432
healthcheck:
test: "pg_isready -U postgres -d orderdb"
interval: 2s
timeout: 20s
retries: 10
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=orderdb
shipment-db:
build:
context: ./.docker/shipment-db
dockerfile: Dockerfile
container_name: shipment-db
ports:
- 5433:5432
healthcheck:
test: "pg_isready -U postgres -d shipmentdb"
interval: 2s
timeout: 20s
retries: 10
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=shipmentdb
debezium-server:
build:
context: ./.docker/debezium
dockerfile: Dockerfile
container_name: debezium-server
ports:
- 8080:8080
depends_on:
rabbitmq:
condition: service_healthy
order-db:
condition: service_started
environment:
- DATABASE_HOSTNAME=order-db
- DATABASE_PORT=5432
- DATABASE_USER=postgres
- DATABASE_PASSWORD=postgres
- DATABASE_NAME=orderdb
- DATABASE_SCHEMA=orders
- DATABASE_OUTBOX_TABLE=outbox_event
- RABBITMQ_HOSTNAME=rabbitmq
- RABBITMQ_PORT=5672
- RABBITMQ_USER=root
- RABBITMQ_PASSWORD=root
order-service:
build:
context: .
dockerfile: ./.docker/order-service/Dockerfile
container_name: order-service
ports:
- 3000:3000
depends_on:
debezium-server:
condition: service_started
order-db:
condition: service_healthy
healthcheck:
test: "wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1"
interval: 2s
timeout: 20s
retries: 10
environment:
- SERVER_PORT=3000
- DB_NAME=orderdb
- DB_SCHEMA=orders
- DB_PORT=5432
- DB_HOST=order-db
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_DEBUG=true
shipment-service:
build:
context: .
dockerfile: ./.docker/shipment-service/Dockerfile
container_name: shipment-service
ports:
- 3001:3000
depends_on:
rabbitmq:
condition: service_healthy
shipment-db:
condition: service_healthy
healthcheck:
test: "wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1"
interval: 2s
timeout: 20s
retries: 10
environment:
- SERVER_PORT=3001
- DB_NAME=shipmentdb
- DB_SCHEMA=shipments
- DB_PORT=5432
- DB_HOST=shipment-db
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_DEBUG=true
- RABBITMQ_HOST=rabbitmq
- RABBITMQ_PORT=5672
- RABBITMQ_USER=root
- RABBITMQ_PASSWORD=root
- RABBITMQ_ORDER_QUEUE=shipment.orders