forked from thinktecture-labs/cloud-native-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
288 lines (284 loc) · 8.2 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
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
version: "3.9"
services:
loki:
image: grafana/loki:2.5.0
container_name: loki
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
networks:
cloud-native:
ipv4_address: 10.5.0.99
grafana:
image: grafana/grafana-oss:latest
container_name: grafana
ports:
- "3000:3000"
volumes:
- ./docker-compose-configs/grafana/datasources:/etc/grafana/provisioning/datasources
- ./docker-compose-configs/grafana/dashboards:/var/lib/grafana/dashboards
networks:
- cloud-native
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
command:
- --config.file=/etc/prometheus/prometheus.yml
volumes:
- ./docker-compose-configs/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
depends_on:
- cadvisor
networks:
- cloud-native
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: cadvisor
ports:
- "8080:8080"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
depends_on:
- redis
networks:
- cloud-native
redis:
image: redis:latest
container_name: redis
ports:
- "6379:6379"
networks:
- cloud-native
zipkin:
image: "openzipkin/zipkin"
container_name: zipkin
ports:
- "9411:9411"
networks:
- cloud-native
# jaeger:
# image: jaegertracing/all-in-one:1.22
# container_name: jaeger
# environment:
# COLLECTOR_ZIPKIN_HOST_PORT: 9412
# ports:
# - "16686:16686"
# networks:
# - cloud-native
rabbit:
image: rabbitmq:management-alpine
container_name: rabbitmq
ports:
- "15672:15672"
networks:
- cloud-native
gateway:
build: ./src/Gateway
container_name: gateway
logging:
driver: loki
options:
loki-url: http://10.5.0.99:3100/loki/api/v1/push
loki-retries: 5
environment:
ASPNETCORE_ENVIRONMENT: DockerCompose
Gateway__ZipkinEndpoint: http://zipkin:9411/api/v2/spans
DAPR_HTTP_PORT: 9000
networks:
- cloud-native
depends_on:
- zipkin
ports:
- "5000:5000"
gateway-dapr:
image: "daprio/daprd:edge"
container_name: gateway-dapr
command: [ "./daprd",
"-app-id", "gateway",
"-app-port", "5000",
"-dapr-http-port", "9000",
"-dapr-grpc-port", "10000",
"-components-path", "/dapr/components",
"-config", "/dapr/config/config.yml" ]
network_mode: "service:gateway"
volumes:
- ./docker-compose-configs/dapr:/dapr/config
- ./src/dapr/components:/dapr/components
depends_on:
- gateway
orders:
build: ./src/OrdersService
container_name: orders
networks:
- cloud-native
depends_on:
- zipkin
- rabbit
environment:
DAPR_GRPC_PORT: 10002
OrdersService__IdentityServer__Authority: http://localhost:5009
OrdersService__IdentityServer__RequireHttpsMetadata: false
OrdersService__IdentityServer__MetadataAddress: http://authn:5000/.well-known/openid-configuration
OrdersService__ZipkinEndpoint: http://zipkin:9411/api/v2/spans
logging:
driver: loki
options:
loki-url: http://10.5.0.99:3100/loki/api/v1/push
loki-retries: 5
orders-dapr:
image: "daprio/daprd:edge"
container_name: orders-dapr
command: [ "./daprd",
"-app-id", "orders",
"-app-port", "5000",
"-dapr-http-port", "9002",
"-dapr-grpc-port", "10002",
"-components-path", "/dapr/components",
"-config", "/dapr/config/config.yml" ]
network_mode: "service:orders"
volumes:
- ./docker-compose-configs/dapr:/dapr/config
- ./src/dapr/components:/dapr/components
depends_on:
- orders
products:
build: ./src/ProductsService
container_name: products
environment:
DAPR_GRPC_PORT: 10001
ProductsService__ZipkinEndpoint: http://zipkin:9411/api/v2/spans
networks:
- cloud-native
depends_on:
- zipkin
logging:
driver: loki
options:
loki-url: http://10.5.0.99:3100/loki/api/v1/push
loki-retries: 5
products-dapr:
image: "daprio/daprd:edge"
container_name: products-dapr
command: [ "./daprd",
"-app-id", "products",
"-app-port", "5000",
"-dapr-http-port", "9001",
"-dapr-grpc-port", "10001",
"-components-path", "/dapr/components",
"-config", "/dapr/config/config.yml" ]
network_mode: "service:products"
volumes:
- ./docker-compose-configs/dapr:/dapr/config
- ./src/dapr/components:/dapr/components
depends_on:
- products
notification:
build: ./src/NotificationService
container_name: notification
environment:
DAPR_GRPC_PORT: 10004
NotificationService__IdentityServer__Authority: http://localhost:5009
NotificationService__IdentityServer__RequireHttpsMetadata: false
NotificationService__IdentityServer__MetadataAddress: http://authn:5000/.well-known/openid-configuration
NotificationService__ZipkinEndpoint: http://zipkin:9411/api/v2/spans
networks:
- cloud-native
depends_on:
- zipkin
- rabbit
logging:
driver: loki
options:
loki-url: http://10.5.0.99:3100/loki/api/v1/push
loki-retries: 5
notification-dapr:
image: "daprio/daprd:edge"
container_name: notification-dapr
command: [ "./daprd",
"-app-id", "notification",
"-app-port", "5000",
"-dapr-http-port", "9004",
"-dapr-grpc-port", "10004",
"-components-path", "/dapr/components",
"-config", "/dapr/config/config.yml" ]
network_mode: "service:notification"
volumes:
- ./docker-compose-configs/dapr:/dapr/config
- ./src/dapr/components:/dapr/components
depends_on:
- notification
shipping:
build: ./src/ShippingService
container_name: shipping
environment:
DAPR_GRPC_PORT: 10003
ShippingService__Environment: Development
ShippingService__ZipkinEndpoint: http://zipkin:9411/api/v2/spans
networks:
- cloud-native
depends_on:
- zipkin
- rabbit
logging:
driver: loki
options:
loki-url: http://10.5.0.99:3100/loki/api/v1/push
loki-retries: 5
shipping-dapr:
image: "daprio/daprd:edge"
container_name: shipping-dapr
command: [ "./daprd",
"-app-id", "shipping",
"-app-port", "5000",
"-dapr-http-port", "9003",
"-dapr-grpc-port", "10003",
"-components-path", "/dapr/components",
"-config", "/dapr/config/config.yml" ]
network_mode: "service:shipping"
volumes:
- ./docker-compose-configs/dapr:/dapr/config
- ./src/dapr/components:/dapr/components
depends_on:
- shipping
ordermonitor:
build:
context: ./src/OrderMonitorClient
args:
- TARGET=docker-compose
container_name: order-monitor-client
environment:
- IdentityServer__Uri=http://localhost:5009/
ports:
- "5005:8080"
networks:
- cloud-native
authentication:
build: ./src/AuthenticationService
container_name: authn
environment:
IdentityServer__AllowHttp: true
#IdentityServer__InteractiveClient__RedirectUris__0: http://localhost:5005/callback.html
#IdentityServer__InteractiveClient__FrontChannelLogoutUri: http://localhost:5005/signout-oidc
#IdentityServer__InteractiveClient__PostLogoutRedirectUris__0: http://localhost:5005/signout-callback-oidc
#IdentityServer__InteractiveClient__AllowedCorsOrigins__0: http://localhost:5005
ports:
- "5009:5000"
networks:
- cloud-native
logging:
driver: loki
options:
loki-url: http://10.5.0.99:3100/loki/api/v1/push
loki-retries: 5
networks:
cloud-native :
driver: bridge
name: cloud-native
ipam:
config:
- subnet: 10.5.0.0/16
gateway: 10.5.0.1