-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
123 lines (117 loc) · 3.07 KB
/
Copy pathdocker-compose.yml
File metadata and controls
123 lines (117 loc) · 3.07 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
version: "3.9"
services:
redis:
image: redis:7.2
container_name: market-data-redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
postgres:
image: postgres:15
container_name: market-data-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: marketdata
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
- ./docker/init:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d marketdata"]
interval: 10s
timeout: 5s
retries: 5
market_data:
build: .
container_name: market-data-service
command: ["python", "-m", "market_data.app"]
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
environment:
REDIS_URL: redis://redis:6379/0
REDIS_TICK_STREAM: marketdata_ticks
REDIS_ORDER_BOOK_STREAM: marketdata_order_books
REDIS_DEALER_QUOTE_STREAM: marketdata_dealer_quotes
POSTGRES_DSN: postgresql://postgres:postgres@postgres:5432/marketdata
POSTGRES_SCHEMA: public
MARKET_DATA_INTERVAL_SECONDS: "0.2"
MARKET_DATA_HTTP_HOST: 0.0.0.0
MARKET_DATA_HTTP_PORT: "8080"
MARKET_DATA_CORS_ORIGINS: http://localhost:5173
volumes:
- .:/app:ro
ports:
- "8080:8080"
trading_agent:
build: .
container_name: trading-agent-service
command:
[
"uvicorn",
"trading.app:create_default_app",
"--factory",
"--host",
"0.0.0.0",
"--port",
"8081",
]
ports:
- "8081:8081"
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
market_data:
condition: service_started
environment:
TRADING_REDIS_URL: redis://redis:6379/0
TRADING_POSTGRES_DSN: postgresql://postgres:postgres@postgres:5432/marketdata
TRADING_MARKETDATA_STREAM: marketdata_stream
TRADING_EXECUTION_STREAM: execution_stream
TRADING_ORDER_STREAM: order_commands
TRADING_CORS_ORIGINS: http://localhost:5173
TRADING_SESSION_COOKIE_NAME: session_id
TRADING_SESSION_TTL_MINUTES: "60"
volumes:
- .:/app:ro
auth_service:
build: .
container_name: auth-service
command:
[
"uvicorn",
"auth.server:create_default_app",
"--factory",
"--host",
"0.0.0.0",
"--port",
"8082",
]
ports:
- "8082:8082"
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
environment:
AUTH_POSTGRES_DSN: postgresql://postgres:postgres@postgres:5432/marketdata
AUTH_POSTGRES_SCHEMA: public
AUTH_REDIS_URL: redis://redis:6379/0
AUTH_SESSION_TTL_MINUTES: "60"
AUTH_SECURE_COOKIES: "false"
AUTH_CORS_ORIGINS: http://localhost:5173
volumes:
- .:/app:ro
volumes:
postgres-data: