-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.services.yml
More file actions
278 lines (266 loc) · 6.97 KB
/
Copy pathdocker-compose.services.yml
File metadata and controls
278 lines (266 loc) · 6.97 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
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
networks:
logistics-net:
external: true
x-service-common: &service-common
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
env_file: .env
networks:
- logistics-net
volumes:
- ./tests/e2e:/app/tests/e2e:ro
- ./libs:/app/libs:ro
- ./tests/e2e/tsconfig.json:/app/tests/e2e/tsconfig.json:ro
- ./tests/e2e/jest.config.js:/app/tests/e2e/jest.config.js:ro
depends_on:
pg-order:
condition: service_healthy
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
services:
osrm:
image: ghcr.io/project-osrm/osrm-backend:latest
ports:
- "5000:5000"
volumes:
- ./osrm-data:/data
command: >
osrm-routed
--algorithm mld
/data/russia-latest.osrm
networks:
- logistics-net
restart: unless-stopped
api-gateway:
<<: *service-common
build:
context: .
dockerfile: Dockerfile
args:
SERVICE: api-gateway
ports:
- '${HTTP_GATEWAY_PORT:-3000}:3000'
- '9410:9414'
environment:
SERVICE_NAME: api-gateway
HTTP_PORT: 3000
HTTP_METRICS_PORT: 9414
PROTO_ROOT: /app/libs/proto/src
AUTH_DB_HOST: pg-auth
AUTH_DB_PORT: 5432
GRPC_INVOICE_HOST: invoice-service:50052
GRPC_ORDER_HOST: order-service:50051
GRPC_FLEET_HOST: fleet-service:50053
GRPC_ROUTING_HOST: routing-service:50054
GRPC_TRACKING_HOST: tracking-service:50055
GRPC_DISPATCHER_HOST: dispatcher-service:50056
GRPC_COUNTERPARTY_HOST: counterparty-service:50057
depends_on:
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
# order-service:
# condition: service_started
invoice-service:
condition: service_started
counterparty-service:
condition: service_started
order-service:
<<: *service-common
build:
args: { SERVICE: order-service }
ports:
- '3011:3011'
- '50051:50051'
- '9411:9414'
environment:
SERVICE_NAME: order-service
HTTP_PORT: 3011
HTTP_METRICS_PORT: 9414
GRPC_ORDER_PORT: 50051
ORDER_DB_HOST: pg-order
depends_on:
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
pg-order:
condition: service_healthy
fleet-service:
<<: *service-common
build:
args: { SERVICE: fleet-service }
ports:
- '3013:3013'
- '50053:50053'
- '9412:9414'
environment:
SERVICE_NAME: fleet-service
HTTP_PORT: 3013
HTTP_METRICS_PORT: 9414
GRPC_FLEET_PORT: 50053
FLEET_DB_HOST: pg-fleet
depends_on:
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
pg-fleet:
condition: service_healthy
routing-service:
<<: *service-common
build:
args: { SERVICE: routing-service }
ports:
- '3014:3014'
- '50054:50054'
- '9413:9414'
environment:
SERVICE_NAME: routing-service
HTTP_PORT: 3014
HTTP_METRICS_PORT: 9414
GRPC_ROUTING_PORT: 50054
ROUTING_DB_HOST: pg-routing
depends_on:
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
pg-routing:
condition: service_healthy
tracking-service:
<<: *service-common
build:
args: { SERVICE: tracking-service }
ports:
- '50055:50055'
- '9414:9414'
environment:
SERVICE_NAME: tracking-service
HTTP_METRICS_PORT: 9414
GRPC_TRACKING_PORT: 50055
TRACKING_DB_HOST: pg-tracking
TRACKING_BATCH_SIZE: 500
TRACKING_BATCH_TIMEOUT_MS: 200
depends_on:
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
pg-tracking:
condition: service_healthy
dispatcher-service:
<<: *service-common
build:
args: { SERVICE: dispatcher-service }
ports:
- '50056:50056'
- '9415:9414'
environment:
SERVICE_NAME: dispatcher-service
HTTP_METRICS_PORT: 9414
GRPC_DISPATCHER_PORT: 50056
DISPATCHER_DB_HOST: pg-dispatcher
GRPC_ORDER_HOST: order-service:50051
GRPC_FLEET_HOST: fleet-service:50053
GRPC_ROUTING_HOST: routing-service:50054
depends_on:
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
pg-dispatcher:
condition: service_healthy
order-service:
condition: service_started
fleet-service:
condition: service_started
routing-service:
condition: service_started
counterparty-service:
<<: *service-common
build:
args: { SERVICE: counterparty-service }
ports:
- '3016:3016'
- '50057:50057'
- '9416:9414'
environment:
SERVICE_NAME: counterparty-service
HTTP_PORT: 3016
HTTP_METRICS_PORT: 9414
GRPC_COUNTERPARTY_PORT: 50057
COUNTERPARTY_DB_HOST: pg-counterparty
depends_on:
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
pg-counterparty:
condition: service_healthy
invoice-service:
<<: *service-common
build:
args: { SERVICE: invoice-service }
ports:
- '3012:3012'
- '50052:50052'
- '9417:9414'
environment:
SERVICE_NAME: invoice-service
HTTP_PORT: 3012
HTTP_METRICS_PORT: 9414
GRPC_INVOICE_PORT: 50052
INVOICE_DB_HOST: pg-invoice
GRPC_ORDER_HOST: order-service:50051
GRPC_COUNTERPARTY_HOST: counterparty-service:50057
INVOICE_S3_ENDPOINT: http://minio:9000
INVOICE_S3_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minio}
INVOICE_S3_SECRET_KEY: ${MINIO_SECRET_KEY:-minio123}
INVOICE_S3_BUCKET: invoices
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-minio}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-minio123}
depends_on:
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
# invoice-service:
# condition: service_started
order-service:
condition: service_started
telemetry-sim:
build:
context: ./infra/telemetry-sim
dockerfile: Dockerfile
command: node telemetry-sim.js
environment:
KAFKA_BROKER: kafka:9092
SIM_VEHICLE_COUNT: ${SIM_VEHICLE_COUNT:-300}
SIM_TELEMETRY_HZ: ${SIM_TELEMETRY_HZ:-2}
depends_on:
kafka-init:
condition: service_completed_successfully
networks:
- logistics-net
profiles:
- simulation
traffic-sim:
build:
context: ./infra/traffic-sim
dockerfile: Dockerfile
command: node traffic-sim.js
environment:
KAFKA_BROKER: kafka:9092
depends_on:
kafka-init:
condition: service_completed_successfully
networks:
- logistics-net
profiles:
- simulation