-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
208 lines (190 loc) · 4.51 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
version: '3.5'
services:
gateway:
build:
context: .
dockerfile: ./gateway/Dockerfile
container_name: gateway
image: gateway
ports:
- 50052:50052
- 8080:8080
depends_on:
- order
- user
- cart
- product
order:
build:
context: .
dockerfile: ./order/Dockerfile
container_name: order
image: order
environment:
PG_URL: 'postgres://postgres:root@order_postgres:5432/postgres?sslmode=disable'
ports:
- 50051:50051
depends_on:
order_postgres:
condition: service_healthy
user:
build:
context: .
dockerfile: ./user/Dockerfile
container_name: user
image: user
environment:
PG_URL: 'postgres://postgres:root@user_postgres:5432/postgres?sslmode=disable'
ports:
- 50053:50053
depends_on:
user_postgres:
condition: service_healthy
cart:
build:
context: .
dockerfile: ./cart/Dockerfile
container_name: cart
image: cart
environment:
REDIS_URL: 'redis://cart_redis:6379/0'
PG_URL: 'postgres://postgres:root@cart_postgres:5432/postgres?sslmode=disable'
ports:
- 50054:50054
depends_on:
cart_postgres:
condition: service_healthy
cart_redis:
condition: service_healthy
product:
build:
context: .
dockerfile: ./product/Dockerfile
container_name: product
image: product
environment:
REDIS_URL: 'redis://product_redis:6379/0'
PG_URL: 'postgres://postgres:root@product_postgres:5432/postgres?sslmode=disable'
ports:
- 50055:50055
depends_on:
product_postgres:
condition: service_healthy
product_redis:
condition: service_healthy
order_postgres:
container_name: order_pg_db
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=root
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
volumes:
- order-pg-data:/var/lib/postgresql/data
image: postgres:15-alpine
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1s
timeout: 1s
retries: 10
user_postgres:
container_name: user_pg_db
ports:
- 5433:5432
environment:
- POSTGRES_PASSWORD=root
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
volumes:
- user-pg-data:/var/lib/postgresql/data
image: postgres:15-alpine
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1s
timeout: 1s
retries: 10
cart_postgres:
container_name: cart_pg_db
ports:
- 5434:5432
environment:
- POSTGRES_PASSWORD=root
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
volumes:
- cart-pg-data:/var/lib/postgresql/data
image: postgres:15-alpine
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1s
timeout: 1s
retries: 10
cart_redis:
container_name: cart_redis_db
image: redis:7.2.3-alpine3.18
volumes:
- cart-redis-data:/data
ports:
- 6379:6379
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 1s
retries: 10
product_postgres:
container_name: product_pg_db
ports:
- 5435:5432
environment:
- POSTGRES_PASSWORD=root
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
volumes:
- product-pg-data:/var/lib/postgresql/data
image: postgres:15-alpine
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1s
timeout: 1s
retries: 10
product_redis:
container_name: product_redis_db
image: redis:7.2.3-alpine3.18
volumes:
- product-redis-data:/data
ports:
- 6380:6379
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 1s
retries: 10
# rabbitmq:
# container_name: rabbitmq
# image: rabbitmq:3.8-management-alpine
# hostname: rabbitmq
# environment:
# RABBITMQ_DEFAULT_USER: rabbitmq
# RABBITMQ_DEFAULT_PASS: rabbitmq
# RABBITMQ_DEFAULT_VHOST: /
# ports:
# # The standard AMQP protocol port
# - 5672:5672
# # HTTP management UI
# - 15672:15672
volumes:
order-pg-data:
name: order-pg-data
user-pg-data:
name: user-pg-data
cart-redis-data:
name: cart-redis-data
cart-pg-data:
name: cart-pg-data
product-pg-data:
name: product-pg-data
product-redis-data:
name: product-redis-data