-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
260 lines (244 loc) · 6.1 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
version: '3.4'
services:
nats-server:
container_name: nats-server
image: nats:latest
ports:
- 4222:4222
- 8222:8222
eventstore:
container_name: eventstore
image: eventstore/eventstore:24.10.1-alpha-arm64v8
environment:
- EVENTSTORE_CLUSTER_SIZE=1
- EVENTSTORE_RUN_PROJECTIONS=All
- EVENTSTORE_START_STANDARD_PROJECTIONS=true
- EVENTSTORE_NODE_PORT=2113
- EVENTSTORE_INSECURE=true
- EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
ports:
- ${EVENT_STORE_PORT}:2113
volumes:
- type: volume
source: eventstore-volume-data
target: /var/lib/eventstore
- type: volume
source: eventstore-volume-logs
target: /var/log/eventstore
api-gateway:
#container_name: api-gateway
restart: always
build:
context: .
dockerfile: ./apps/api-gateway/Dockerfile
target: build
command: npm run start:dev
environment:
- PORT=${API_GATEWAY_PORT}
- NATS_SERVER=nats://nats-server:4222
- EVENT_STORE_HOST=eventstore
- EVENT_STORE_PORT=2113
- DEFAULT_LANGUAGE=${DEFAULT_LANGUAGE}
- TRANSLATION_PATH=../../../resources/i18n
depends_on:
- nats-server
deploy:
replicas: 3
volumes:
- .:/src/app
- /src/app/node_modules
#ports:
# - ${API_GATEWAY_PORT}:3000
gateway-nginx:
build:
context: .
dockerfile: ./nginx.Dockerfile
container_name: gateway-nginx
ports:
- "3000:80"
depends_on:
- api-gateway
auth-ms:
container_name: auth-ms
restart: always
build:
context: .
dockerfile: ./apps/auth/Dockerfile
target: build
command: npm run start:dev auth
environment:
- AUTHDB_HOST=users-db
- AUTHDB_PORT=${AUTHDB_PORT}
- AUTHDB_PASSWORD=${AUTHDB_PASSWORD}
- NATS_SERVER=nats://nats-server:4222
- EVENT_STORE_HOST=eventstore
- EVENT_STORE_PORT=2113
- JWT_SECRET=${JWT_SECRET}
depends_on:
- api-gateway
- users-db
volumes:
- .:/src/app
- /src/app/node_modules
users-db:
container_name: users-db
image: redis/redis-stack:latest
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ]
interval: 1s
timeout: 3s
retries: 5
command: [ "redis-server", "--save", "20", "1", "--requirepass", "${AUTHDB_PASSWORD}", "--loadmodule", "/opt/redis-stack/lib/redisearch.so", "--loadmodule", "/opt/redis-stack/lib/rejson.so" ]
ports:
- ${AUTHDB_PORT}:6379
- 8011:8001
volumes:
- redis_data:/data
activity-booking-ms:
container_name: activity-booking-ms
restart: always
build:
context: .
dockerfile: ./apps/activity-booking/Dockerfile
target: build
command: npm run start:dev activity-booking
environment:
- EVENT_STORE_HOST=eventstore
- EVENT_STORE_PORT=2113
depends_on:
- eventstore
volumes:
- .:/src/app
- /src/app/node_modules
billing-ms:
container_name: billing-ms
restart: always
build:
context: .
dockerfile: ./apps/billing/Dockerfile
target: build
command: npm run start:dev billing
environment:
- EVENT_STORE_HOST=eventstore
- EVENT_STORE_PORT=2113
depends_on:
- eventstore
volumes:
- .:/src/app
- /src/app/node_modules
flight-booking-ms:
container_name: flight-booking-ms
restart: always
build:
context: .
dockerfile: ./apps/flight-booking/Dockerfile
target: build
command: npm run start:dev flight-booking
environment:
- EVENT_STORE_HOST=eventstore
- EVENT_STORE_PORT=2113
depends_on:
- eventstore
volumes:
- .:/src/app
- /src/app/node_modules
hotel-booking-ms:
container_name: hotel-booking-ms
restart: always
build:
context: .
dockerfile: ./apps/hotel-booking/Dockerfile
target: build
command: npm run start:dev hotel-booking
environment:
- EVENT_STORE_HOST=eventstore
- EVENT_STORE_PORT=2113
depends_on:
- eventstore
volumes:
- .:/src/app
- /src/app/node_modules
vehicle-rental-ms:
container_name: vehicle-rental-ms
restart: always
build:
context: .
dockerfile: ./apps/vehicle-rental/Dockerfile
target: build
command: npm run start:dev vehicle-rental
environment:
- EVENT_STORE_HOST=eventstore
- EVENT_STORE_PORT=2113
depends_on:
- eventstore
volumes:
- .:/src/app
- /src/app/node_modules
query-db:
container_name: query-db
image: surrealdb/surrealdb:latest
environment:
- DB_USER=$QUERY_DB_USER
- DB_PASSWORD=$QUERY_DB_PASSWORD
entrypoint:
- /surreal
- start
- --user
- $QUERY_DB_USER
- --pass
- $QUERY_DB_PASSWORD
- surrealkv://data
ports:
- 8000:8000
volumes:
- ./data/query_data:/data
query-api:
container_name: query-api
restart: always
build:
context: .
dockerfile: ./apps/query-api/Dockerfile
target: build
command: npm run start:dev query-api
environment:
- DB_USER=$QUERY_DB_USER
- DB_PASSWORD=$QUERY_DB_PASSWORD
- SURREAL_HOST=query-db
- SURREAL_PORT=8000
- SURREAL_DATABASE=TRIPS
- SURREAL_NAMESPACE=MAIN
depends_on:
- eventstore
- query-db
ports:
- ${QUERY_API_PORT}:3000
volumes:
- .:/src/app
- /src/app/node_modules
projectors:
container_name: projectors
restart: always
build:
context: .
dockerfile: ./apps/projectors/Dockerfile
target: build
command: npm run start:dev projectors
environment:
- EVENT_STORE_HOST=eventstore
- EVENT_STORE_PORT=2113
- DB_USER=$QUERY_DB_USER
- DB_PASSWORD=$QUERY_DB_PASSWORD
- SURREAL_HOST=query-db
- SURREAL_PORT=8000
- SURREAL_DATABASE=TRIPS
- SURREAL_NAMESPACE=MAIN
depends_on:
- eventstore
- query-db
volumes:
- .:/src/app
- /src/app/node_modules
volumes:
eventstore-volume-data:
eventstore-volume-logs:
redis_data: