forked from GoogleCloudPlatform/microservices-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
237 lines (223 loc) · 5.71 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
237 lines (223 loc) · 5.71 KB
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
version: '3.8'
services:
# Redis for cart service
redis-cart:
image: redis:alpine
container_name: redis-cart
ports:
- "6379:6379"
networks:
- microservices-network
# Ad Service
adservice:
build:
context: ./microservices-demo/src/adservice
dockerfile: Dockerfile
container_name: adservice
ports:
- "9555:9555"
environment:
- PORT=9555
- ENABLE_PROFILER=0
- ENABLE_TRACING=0
networks:
- microservices-network
# Cart Service
cartservice:
build:
context: ./microservices-demo/src/cartservice
dockerfile: Dockerfile
container_name: cartservice
ports:
- "7070:7070"
environment:
- REDIS_ADDR=redis-cart:6379
- ENABLE_PROFILER=0
- ENABLE_TRACING=0
depends_on:
- redis-cart
networks:
- microservices-network
# Product Catalog Service
productcatalogservice:
build:
context: ./microservices-demo/src/productcatalogservice
dockerfile: Dockerfile
container_name: productcatalogservice
ports:
- "3550:3550"
environment:
- PORT=3550
- ENABLE_PROFILER=0
- ENABLE_TRACING=0
networks:
- microservices-network
# Currency Service
currencyservice:
build:
context: ./microservices-demo/src/currencyservice
dockerfile: Dockerfile
container_name: currencyservice
ports:
- "7000:7000"
environment:
- PORT=7000
- ENABLE_PROFILER=0
- ENABLE_TRACING=0
networks:
- microservices-network
# Payment Service
paymentservice:
build:
context: ./microservices-demo/src/paymentservice
dockerfile: Dockerfile
container_name: paymentservice
ports:
- "50051:50051"
environment:
- PORT=50051
- DISABLE_PROFILER=1
- DISABLE_TRACING=1
networks:
- microservices-network
# Shipping Service
shippingservice:
build:
context: ./microservices-demo/src/shippingservice
dockerfile: Dockerfile
container_name: shippingservice
ports:
- "50052:50051"
environment:
- PORT=50051
- ENABLE_PROFILER=0
- ENABLE_TRACING=0
networks:
- microservices-network
# Email Service
emailservice:
build:
context: ./microservices-demo/src/emailservice
dockerfile: Dockerfile
container_name: emailservice
ports:
- "8081:8080"
environment:
- PORT=8080
- ENABLE_PROFILER=0
- ENABLE_TRACING=0
networks:
- microservices-network
# Recommendation Service
recommendationservice:
build:
context: ./microservices-demo/src/recommendationservice
dockerfile: Dockerfile
container_name: recommendationservice
ports:
- "8082:8080"
environment:
- PORT=8080
- PRODUCT_CATALOG_SERVICE_ADDR=productcatalogservice:3550
- ENABLE_PROFILER=0
- ENABLE_TRACING=0
depends_on:
- productcatalogservice
networks:
- microservices-network
# Shopping Assistant Service
shoppingassistantservice:
build:
context: ./microservices-demo/src/shoppingassistantservice
dockerfile: Dockerfile
container_name: shoppingassistantservice
ports:
- "8083:8080"
environment:
- PORT=8080
- PRODUCT_CATALOG_SERVICE_ADDR=productcatalogservice:3550
- PROJECT_ID=local-dev
- REGION=us-central1
- ALLOYDB_DATABASE_NAME=local-db
- ENABLE_PROFILER=0
- ENABLE_TRACING=0
depends_on:
- productcatalogservice
networks:
- microservices-network
# Checkout Service
checkoutservice:
build:
context: ./microservices-demo/src/checkoutservice
dockerfile: Dockerfile
container_name: checkoutservice
ports:
- "5050:5050"
environment:
- PORT=5050
- PRODUCT_CATALOG_SERVICE_ADDR=productcatalogservice:3550
- SHIPPING_SERVICE_ADDR=shippingservice:50051
- PAYMENT_SERVICE_ADDR=paymentservice:50051
- EMAIL_SERVICE_ADDR=emailservice:8080
- CURRENCY_SERVICE_ADDR=currencyservice:7000
- CART_SERVICE_ADDR=cartservice:7070
- ENABLE_PROFILER=0
- ENABLE_TRACING=0
depends_on:
- productcatalogservice
- cartservice
- currencyservice
- shippingservice
- emailservice
- paymentservice
networks:
- microservices-network
# Frontend
frontend:
build:
context: ./microservices-demo/src/frontend
dockerfile: Dockerfile
container_name: frontend
ports:
- "8080:8080"
environment:
- PORT=8080
- PRODUCT_CATALOG_SERVICE_ADDR=productcatalogservice:3550
- CURRENCY_SERVICE_ADDR=currencyservice:7000
- CART_SERVICE_ADDR=cartservice:7070
- RECOMMENDATION_SERVICE_ADDR=recommendationservice:8080
- CHECKOUT_SERVICE_ADDR=checkoutservice:5050
- SHIPPING_SERVICE_ADDR=shippingservice:50051
- AD_SERVICE_ADDR=adservice:9555
- SHOPPING_ASSISTANT_SERVICE_ADDR=shoppingassistantservice:8080
- ENABLE_PROFILER=0
- ENABLE_TRACING=0
depends_on:
- productcatalogservice
- currencyservice
- cartservice
- recommendationservice
- checkoutservice
- shippingservice
- adservice
- shoppingassistantservice
networks:
- microservices-network
# Load Generator
loadgenerator:
build:
context: ./microservices-demo/src/loadgenerator
dockerfile: Dockerfile
container_name: loadgenerator
environment:
- FRONTEND_ADDR=frontend:8080
- USERS=10
- RATE=1
command: ["-f", "locustfile.py", "--host", "http://frontend:8080", "--headless", "-u", "10", "-r", "1"]
depends_on:
- frontend
networks:
- microservices-network
networks:
microservices-network:
driver: bridge