Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
155 lines (146 loc) · 5.07 KB
/
Copy pathdocker-compose.yml
File metadata and controls
155 lines (146 loc) · 5.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
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
# Local development stack. Passwords default to development values; override
# them with environment variables (or a .env file) for anything shared.
# Every container, image and volume is named for the t3 project.
name: t3
services:
postgres:
container_name: t3-postgres
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_DB: t3
POSTGRES_PASSWORD: ${T3_POSTGRES_PASSWORD:-postgres-dev}
volumes:
- pgdata:/var/lib/postgresql/data
- ./deploy/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "t3"]
interval: 2s
retries: 30
server:
container_name: t3-server
image: t3-server
build: { context: ., target: server }
restart: unless-stopped
depends_on:
postgres: { condition: service_healthy }
ports:
- "${T3_PORT:-8080}:8080"
volumes:
- archive:/var/lib/t3/archive
environment:
T3_ENGINE_DATABASE_URL: postgres://t3_engine:engine-dev@postgres:5432/t3?sslmode=disable
T3_LEDGER_DATABASE_URL: postgres://t3_ledger:ledger-dev@postgres:5432/t3?sslmode=disable
T3_GATEWAY_DATABASE_URL: postgres://t3_gateway:gateway-dev@postgres:5432/t3?sslmode=disable
T3_ADMIN_PASSWORD: ${T3_ADMIN_PASSWORD:-admin-dev-password}
T3_MARKET_MAKER_PASSWORD: ${T3_MARKET_MAKER_PASSWORD:-maker-dev-password}
T3_HEARTBEAT: ${T3_HEARTBEAT:-10s}
T3_ARCHIVE_DIR: /var/lib/t3/archive
# Optional settings; see docs/api.md#running. Empty means the server's
# own default.
T3_ADMIN_USERNAME: ${T3_ADMIN_USERNAME:-}
T3_STARTING_CASH: ${T3_STARTING_CASH:-}
T3_LENDING_RATE_BPS: ${T3_LENDING_RATE_BPS:-}
T3_MAX_TRADE_LOAN_BPS: ${T3_MAX_TRADE_LOAN_BPS:-}
T3_MAX_TRADER_LOAN_BPS: ${T3_MAX_TRADER_LOAN_BPS:-}
T3_MARKET_MAKER_CASH: ${T3_MARKET_MAKER_CASH:-}
T3_COMPACT_AFTER: ${T3_COMPACT_AFTER:-}
T3_LOG_LEVEL: ${T3_LOG_LEVEL:-}
# Browser origins that may call the API: the web app, plus any other
# sites that use it.
T3_ALLOWED_ORIGINS: ${T3_ALLOWED_ORIGINS:-http://localhost:${T3_WEB_PORT:-3000}}
healthcheck:
test: ["CMD", "/server", "healthcheck"]
interval: 5s
timeout: 5s
retries: 3
start_period: 30s
mm-liquidity:
container_name: t3-mm-liquidity
image: t3-marketmaker
build: { context: ., target: marketmaker }
depends_on:
server: { condition: service_healthy }
restart: unless-stopped
environment:
T3_API_URL: http://server:8080
T3_MM_USERNAME: mm-liquidity
T3_MM_PASSWORD: ${T3_MARKET_MAKER_PASSWORD:-maker-dev-password}
T3_MM_STRATEGY: liquidity
mm-flow:
container_name: t3-mm-flow
image: t3-marketmaker
build: { context: ., target: marketmaker }
depends_on:
server: { condition: service_healthy }
restart: unless-stopped
environment:
T3_API_URL: http://server:8080
T3_MM_USERNAME: mm-flow
T3_MM_PASSWORD: ${T3_MARKET_MAKER_PASSWORD:-maker-dev-password}
T3_MM_STRATEGY: flow
mm-momentum:
container_name: t3-mm-momentum
image: t3-marketmaker
build: { context: ., target: marketmaker }
depends_on:
server: { condition: service_healthy }
restart: unless-stopped
environment:
T3_API_URL: http://server:8080
T3_MM_USERNAME: mm-momentum
T3_MM_PASSWORD: ${T3_MARKET_MAKER_PASSWORD:-maker-dev-password}
T3_MM_STRATEGY: momentum
mm-news:
container_name: t3-mm-news
image: t3-marketmaker
build: { context: ., target: marketmaker }
depends_on:
server: { condition: service_healthy }
restart: unless-stopped
environment:
T3_API_URL: http://server:8080
T3_MM_USERNAME: mm-news
T3_MM_PASSWORD: ${T3_MARKET_MAKER_PASSWORD:-maker-dev-password}
T3_MM_STRATEGY: news
# The link maker. Its mapping file is secret: copy it to ./links/links.json
# by hand (readable by uid 65532), never into git. Without one it idles.
mm-anchor:
container_name: t3-mm-anchor
image: t3-marketmaker
build: { context: ., target: marketmaker }
entrypoint: ["/linkbot"]
depends_on:
server: { condition: service_healthy }
restart: unless-stopped
volumes:
- ./links:/etc/t3/links:ro
- link:/var/lib/t3/link
environment:
T3_API_URL: http://server:8080
T3_MM_USERNAME: mm-anchor
T3_MM_PASSWORD: ${T3_MARKET_MAKER_PASSWORD:-maker-dev-password}
T3_FINNHUB_API_KEY: ${T3_FINNHUB_API_KEY:-}
T3_FRED_API_KEY: ${T3_FRED_API_KEY:-}
web:
container_name: t3-web
image: t3-web
build: { context: ./web }
restart: unless-stopped
ports:
- "${T3_WEB_PORT:-3000}:8080"
environment:
# The API address browsers use. It is served to the app as /config.json.
T3_API_URL: ${T3_PUBLIC_API_URL:-http://localhost:${T3_PORT:-8080}}
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/healthz"]
interval: 5s
timeout: 5s
retries: 3
volumes:
pgdata:
name: t3-pgdata
archive:
name: t3-archive
link:
name: t3-link