-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yaml
193 lines (179 loc) · 5.63 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
version: "3.7"
services:
postgresql:
image: postgres:14-alpine
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=P@ssw0rd
ports:
- 5432:5432
networks:
- coffeeshop-network
productservice:
image: ${DOCKER_REGISTRY:-ghcr.io/thangchung/try-nomad-dapr}/productapi:${IMAGE_TAG:-latest}
build:
context: ./dotnet/
dockerfile: src/ProductService/Dockerfile
environment:
- ASPNETCORE_ENVIRONMENT=Development
ports:
- "5001:5001"
restart: always
networks:
- coffeeshop-network
productservice-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "productservice",
"-app-port", "5001",
"-placement-host-address", "placement:50006",
"-config", "/build/dapr/local/components/daprConfig.yaml",
"-resources-path", "/build/dapr/local/components"]
volumes:
- "./build/dapr/local/components/:/build/dapr/local/components"
depends_on:
- productservice
restart: always
network_mode: "service:productservice"
counterservice:
image: ${DOCKER_REGISTRY:-ghcr.io/thangchung/try-nomad-dapr}/counterapi:${IMAGE_TAG:-latest}
build:
context: ./dotnet/
dockerfile: ./src/CounterService/Dockerfile
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__counterdb=Server=postgresql;Port=5432;Database=postgres;User Id=postgres;Password=P@ssw0rd
- ProductCatalogAppDaprName=productservice
ports:
- "5002:5002"
depends_on:
- postgresql
- productservice
restart: always
networks:
- coffeeshop-network
counterservice-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "counterservice",
"-app-port", "5002",
"-placement-host-address", "placement:50006",
"-config", "/build/dapr/local/components/daprConfig.yaml",
"-resources-path", "/build/dapr/local/components"]
volumes:
- "./build/dapr/local/components/:/build/dapr/local/components"
depends_on:
- counterservice
restart: always
network_mode: "service:counterservice"
baristaservice:
image: ${DOCKER_REGISTRY:-ghcr.io/thangchung/try-nomad-dapr}/baristaapi:${IMAGE_TAG:-latest}
build:
context: ./dotnet/
dockerfile: ./src/BaristaService/Dockerfile
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__baristadb=Server=postgresql;Port=5432;Database=postgres;User Id=postgres;Password=P@ssw0rd
ports:
- "5003:5003"
depends_on:
- postgresql
restart: always
networks:
- coffeeshop-network
baristaservice-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "baristaservice",
"-app-port", "5003",
"-placement-host-address", "placement:50006",
"-config", "/build/dapr/local/components/daprConfig.yaml",
"-resources-path", "/build/dapr/local/components"]
volumes:
- "./build/dapr/local/components/:/build/dapr/local/components"
depends_on:
- baristaservice
restart: always
network_mode: "service:baristaservice"
kitchenservice:
image: ${DOCKER_REGISTRY:-ghcr.io/thangchung/try-nomad-dapr}/kitchenapi:${IMAGE_TAG:-latest}
build:
context: ./dotnet/
dockerfile: ./src/KitchenService/Dockerfile
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__kitchendb=Server=postgresql;Port=5432;Database=postgres;User Id=postgres;Password=P@ssw0rd
ports:
- "5004:5004"
depends_on:
- postgresql
restart: always
networks:
- coffeeshop-network
kitchenservice-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "kitchenservice",
"-app-port", "5004",
"-placement-host-address", "placement:50006",
"-config", "/build/dapr/local/components/daprConfig.yaml",
"-resources-path", "/build/dapr/local/components"]
volumes:
- "./build/dapr/local/components/:/build/dapr/local/components"
depends_on:
- kitchenservice
restart: always
network_mode: "service:kitchenservice"
reverseproxy:
image: ${DOCKER_REGISTRY:-ghcr.io/thangchung/try-nomad-dapr}/reverse-proxy:${IMAGE_TAG:-latest}
build:
context: ./dotnet/
dockerfile: ./src/ReverseProxy/Dockerfile
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ReverseProxy__Clusters__productApiCluster__Destinations__destination1__Address=http://productservice:5001
- ReverseProxy__Clusters__counterApiCluster__Destinations__destination1__Address=http://counterservice:5002
ports:
- "8080:8080"
depends_on:
- postgresql
- counterservice
restart: always
networks:
- coffeeshop-network
reverseproxy-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "reverseproxy",
"-app-port", "8080",
"-placement-host-address", "placement:50006",
"-config", "/build/dapr/local/components/daprConfig.yaml",
"-resources-path", "/build/dapr/local/components"]
volumes:
- "./build/dapr/local/components/:/build/dapr/local/components"
depends_on:
- reverseproxy
restart: always
network_mode: "service:reverseproxy"
############################
# Redis state store
############################
redis:
image: "redis:alpine"
ports:
- "6379:6379"
networks:
- coffeeshop-network
############################
# Zipkin component
############################
zipkin:
image: openzipkin/zipkin:latest
container_name: zipkin
ports:
- "9411:9411"
networks:
- coffeeshop-network
networks:
coffeeshop-network: