-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
159 lines (151 loc) · 3.98 KB
/
docker-compose.yml
File metadata and controls
159 lines (151 loc) · 3.98 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
version: '3.8'
services:
postgres:
image: timescale/timescaledb:latest-pg16
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: accounts
ports:
- "5433:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
matching-engine-service:
build:
context: .
dockerfile: matching_engine_service/Dockerfile
depends_on:
postgres:
condition: service_healthy
accounts:
condition: service_healthy
environment:
# UDP transport config
ORDER_RECEIVER_BIND: 0.0.0.0:9100
GATEWAY_EVENT_ADDR: gateway:9101
EVENT_SENDER_BIND: 0.0.0.0:9103
SYMBOL: KCN/EUR
BIND_ADDR: 0.0.0.0:8080
# Settlement config
ACCOUNTS_URL: http://accounts:3001
ports:
- "8080:8080"
- "9100:9100/udp"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
gateway:
build:
context: .
dockerfile: gateway/Dockerfile
depends_on:
accounts:
condition: service_healthy
matching-engine-service:
condition: service_healthy
environment:
# UDP transport config
MATCHING_ENGINE_UDP_ADDR: matching-engine-service:9100
ORDER_SENDER_BIND: 0.0.0.0:9102
EVENT_RECEIVER_BIND: 0.0.0.0:9101
ACCOUNTS_URL: http://accounts:3001
MARKET_DATA_URL: http://market-data:3002
BIND_ADDR: 0.0.0.0:3000
ports:
- "3000:3000"
- "9101:9101/udp"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
accounts:
build:
context: .
dockerfile: accounts/Dockerfile
depends_on:
postgres:
condition: service_healthy
environment:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/accounts
JWT_SECRET: change-this-in-production
BIND_ADDR: 0.0.0.0:3001
ENVIRONMENT: development
# Mail provider: "console" (logs OTP to stdout) or "smtp"
MAIL_PROVIDER: console
# Uncomment for SMTP:
# MAIL_PROVIDER: smtp
# SMTP_HOST: smtp.example.com
# SMTP_PORT: 587
# SMTP_USERNAME: your-username
# SMTP_PASSWORD: your-password
# SMTP_FROM: noreply@example.com
ports:
- "3001:3001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
market-data:
build:
context: .
dockerfile: market_data/Dockerfile
depends_on:
postgres:
condition: service_healthy
gateway:
condition: service_healthy
environment:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/accounts
# Will subscribe to gateway WebSocket for events
GATEWAY_WS_URL: ws://gateway:3000/ws
BIND_ADDR: 0.0.0.0:3002
ports:
- "3002:3002"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3002/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
args:
VITE_GATEWAY_URL: ws://localhost:5173/ws
VITE_API_URL: http://localhost:5173
depends_on:
gateway:
condition: service_healthy
ports:
- "5173:80"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/"]
interval: 10s
timeout: 5s
retries: 5
trading-bot:
build:
context: .
dockerfile: trading_bot/Dockerfile
depends_on:
gateway:
condition: service_healthy
accounts:
condition: service_healthy
command: ["--gateway-host", "gateway", "--gateway-port", "3000", "--all"]
restart: unless-stopped
volumes:
postgres_data: