-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
295 lines (270 loc) · 7.01 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
289
290
291
292
293
294
295
version: '3.4'
services:
#API gateway
api_gateway:
image: ${DOCKER_REGISTRY-}api_gateway
container_name: api_gateway
build: api_gateway
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://+:80
- "AuthSettings:AuthPath=http://auth_server:8000"
- "AuthSettings:RefreshTokenPath=/api/v1/refresh"
- SecretKey=X]E&`I\"mCdS1Y3uD+}_*lU?0~@|S6c
#depends_on:
# - auth_server
# - crypto_server
# - lotserver
# - appeals_server
# - wallets_server
# - chat_server
# - trade_server
ports:
- "3227:80"
#For notification service
notification_server:
container_name: notification_server
build: notification_module
depends_on:
- notification-server-migrate
- notification_db
- consumer
ports:
- "8088:8000"
env_file: notification_module/.env
notification_db:
container_name: notification_db
image: postgres:14
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 1s
timeout: 5s
retries: 5
env_file:
- notification_module/.database.env
volumes:
- notification-postgres-data:/var/lib/postgresql/data
notification-server-migrate:
container_name: notification_migrate
build: notification_module
depends_on:
notification_db:
condition: service_healthy
entrypoint: [ "alembic", "upgrade", "head" ]
env_file: notification_module/.env
consumer:
container_name: consumer
build: notification_module
depends_on: [ broker ]
env_file: notification_module/.consumer.env
#For authorization service
auth_server:
container_name: auth_server
build: auth_module
depends_on:
- auth_migrate
ports:
- "8000:8000"
env_file: auth_module/.env
auth_db:
container_name: auth_db
image: postgres:14
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 1s
timeout: 5s
retries: 5
env_file:
- auth_module/.database.env
volumes:
- postgres-data-auth:/var/lib/postgresql/data
auth_migrate:
container_name: auth_migrate
build: auth_module
depends_on:
auth_db:
condition: service_healthy
entrypoint: [ "alembic", "upgrade", "head" ]
env_file: auth_module/.env
#Trade service
trade_server:
build: trade_module
container_name: trade_server
depends_on:
- trade_migrate
ports:
- "4227:8000"
env_file: trade_module/.env
trade_db:
container_name: trade_db
image: postgres:14
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 1s
timeout: 5s
retries: 5
env_file:
- trade_module/.database.env
volumes:
- postgres-data-trade:/var/lib/postgresql/data
ports:
- "5433:5432"
trade_migrate:
build: trade_module
container_name: trade_migrate
depends_on:
trade_db:
condition: service_healthy
entrypoint: [ "alembic", "upgrade", "head" ]
env_file: trade_module/.env
celery:
container_name: celery
build: trade_module
depends_on: [ broker, trade_server ]
entrypoint: "celery -A core.celery_app.celery worker --loglevel=info"
env_file:
- trade_module/.env
broker:
container_name: broker
image: redis:6
ports:
- "6379:6379"
#For crypto and wallet microservices
ganache:
image: trufflesuite/ganache-cli
container_name: ganache
command: bash "npm install -g ganache && ganache-cli --host 0.0.0.0"
restart: always
ports:
- "8545:8545"
crypto_database:
image: mongo
container_name: crypto_database
restart: always
ports:
- "27017:27017"
crypto_server:
image: ${DOCKER_REGISTRY-}crypto_server
container_name: crypto_server
build:
context: crypto
dockerfile: ./Crypto.Server/Dockerfile
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://+:80
- "DatabaseSettings:ConnectionString=mongodb://crypto_database:27017"
- "BlockchainConnections:Ganache=http://ganache:8545"
- "SmartContractSettings:TokenAddress=0x7DF9D3654d9bbF6FcC132e50CaB27Fa31458FfC8"
depends_on:
- crypto_database
- ganache
- wallets_server
ports:
- "5227:80"
wallets_server:
image: ${DOCKER_REGISTRY-}wallets_server
container_name: wallets_server
build:
context: crypto
dockerfile: ./Wallets.Server/Dockerfile
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://+:80
- "DatabaseSettings:ConnectionString=mongodb://crypto_database:27017"
- "BlockchainConnections:Ganache=http://ganache:8545"
- "SmartContractSettings:TokenAddress=0x7DF9D3654d9bbF6FcC132e50CaB27Fa31458FfC8"
depends_on:
- crypto_database
- ganache
ports:
- "6227:80"
#Lot service
lot_db:
image: postgres:14
container_name: lot_db
environment:
PGUSER: postgres
POSTGRES_DB: lot_db
POSTGRES_PASSWORD: 1337
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 1s
timeout: 5s
retries: 5
volumes:
- postgres-data-lot:/var/lib/postgresql/data
ports:
- 5432:5432
lot_migration:
container_name: lot_migration
restart: "no"
depends_on:
lot_db:
condition: service_healthy
build: lot_service
entrypoint: python manage.py migrate
env_file:
- lot_service/.env
lotserver:
platform: linux/amd64
container_name: lotserver
build: lot_service
image: lot_service
env_file:
- lot_service/.env
depends_on: [ lot_db, lot_migration ]
volumes:
- ./lot_service/:/app
- .:/lot_service
ports:
- "8227:8000"
#Chat service
chat_database:
image: redis
container_name: chat_database
restart: always
ports:
- "5379:5379"
chat_server:
image: chat_server
container_name: chat_server
build: chat_service
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://+:80
- "ConnectionStrings:Redis=chat_database"
- "ApiGateway=http://api_gateway:80"
depends_on:
- chat_database
ports:
- "7227:80"
#Appeals
appeals_database:
image: mysql
container_name: appeals_database
restart: always
environment:
- MYSQL_ROOT_PASSWORD=root
ports:
- "3306:3306"
appeals_server:
image: appeals_server
container_name: appeals_server
build:
context: appeal_service/AppealService
dockerfile: ./Dockerfile
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://+:80
- "ConnectionStrings:DefaultConnection=Server=appeals_database;Uid=root;Pwd=root;Database=appeal_db;"
- "ApiSettings:UsersAddress=http://auth_server:8000"
- "ApiSettings:WalletsAddress=http://wallets_server:80"
depends_on:
- appeals_database
ports:
- "9227:80"
volumes:
postgres-data-auth:
postgres-data-trade:
postgres-data-lot:
notification-postgres-data: