-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.local.yaml
More file actions
246 lines (228 loc) · 9.22 KB
/
docker-compose.local.yaml
File metadata and controls
246 lines (228 loc) · 9.22 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
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
# ═══════════════════════════════════════════════════════════════════════════════
# AWARE Fund - Local Development Stack
# ═══════════════════════════════════════════════════════════════════════════════
# One command to start everything: docker compose -f docker-compose.local.yaml up
# ═══════════════════════════════════════════════════════════════════════════════
name: aware-local
services:
# ═══════════════════════════════════════════════════════════════════════════
# INFRASTRUCTURE
# ═══════════════════════════════════════════════════════════════════════════
redpanda:
image: redpandadata/redpanda:v24.2.11
container_name: aware-redpanda
command:
- redpanda start
- --overprovisioned
- --smp 1
- --memory 1G
- --reserve-memory 0M
- --node-id 0
- --check=false
- --kafka-addr INTERNAL://0.0.0.0:29092,EXTERNAL://0.0.0.0:9092
- --advertise-kafka-addr INTERNAL://redpanda:29092,EXTERNAL://localhost:9092
ports:
- "9092:9092"
- "9644:9644"
volumes:
# PERSISTENT STORAGE - survives docker prune!
- ./data/redpanda:/var/lib/redpanda/data
healthcheck:
test: ["CMD", "rpk", "cluster", "health"]
interval: 10s
timeout: 5s
retries: 5
clickhouse:
image: clickhouse/clickhouse-server:24.8
container_name: aware-clickhouse
depends_on:
redpanda:
condition: service_healthy
ports:
- "8123:8123"
- "9000:9000"
volumes:
- ./analytics-service/clickhouse/init:/docker-entrypoint-initdb.d:ro
- ./analytics-service/clickhouse/users.d/default-user.xml:/etc/clickhouse-server/users.d/default-user.xml:ro
# PERSISTENT STORAGE - survives docker prune!
- ./data/clickhouse:/var/lib/clickhouse
healthcheck:
test: ["CMD", "clickhouse-client", "--query", "SELECT 1"]
interval: 10s
timeout: 5s
retries: 5
# ═══════════════════════════════════════════════════════════════════════════
# JAVA SERVICES (built from source)
# ═══════════════════════════════════════════════════════════════════════════
executor:
build:
context: .
dockerfile: deploy/Dockerfile.java
args:
SERVICE: executor-service
container_name: aware-executor
depends_on:
clickhouse:
condition: service_healthy
environment:
SPRING_PROFILES_ACTIVE: develop
CLICKHOUSE_URL: jdbc:clickhouse://clickhouse:8123/polybot
KAFKA_BOOTSTRAP_SERVERS: redpanda:29092
HFT_MODE: PAPER
JAVA_OPTS: "-Xmx512m -Xms256m"
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/api/polymarket/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
strategy:
build:
context: .
dockerfile: deploy/Dockerfile.java
args:
SERVICE: strategy-service
container_name: aware-strategy
depends_on:
executor:
condition: service_healthy
environment:
SPRING_PROFILES_ACTIVE: develop
CLICKHOUSE_URL: jdbc:clickhouse://clickhouse:8123/polybot
KAFKA_BOOTSTRAP_SERVERS: redpanda:29092
EXECUTOR_BASE_URL: http://executor:8080
HFT_MODE: PAPER
JAVA_OPTS: "-Xmx1g -Xms512m"
ports:
- "8081:8081"
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8081/api/strategy/status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 90s
ingestor:
build:
context: .
dockerfile: deploy/Dockerfile.java
args:
SERVICE: ingestor-service
container_name: aware-ingestor
depends_on:
clickhouse:
condition: service_healthy
environment:
SPRING_PROFILES_ACTIVE: develop
CLICKHOUSE_URL: jdbc:clickhouse://clickhouse:8123/polybot
KAFKA_BOOTSTRAP_SERVERS: redpanda:29092
JAVA_OPTS: "-Xmx512m -Xms256m"
ports:
- "8083:8083"
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8083/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# ═══════════════════════════════════════════════════════════════════════════
# PYTHON SERVICES
# ═══════════════════════════════════════════════════════════════════════════
analytics:
build:
context: ./aware-fund/services/analytics
container_name: aware-analytics
depends_on:
clickhouse:
condition: service_healthy
environment:
CLICKHOUSE_HOST: clickhouse
CLICKHOUSE_PORT: 8123
CLICKHOUSE_DATABASE: polybot
SCORING_INTERVAL_SECONDS: 3600
LOG_LEVEL: INFO
volumes:
# Mount ML checkpoints so trained models persist and are available
- ./aware-fund/services/analytics/ml/checkpoints:/app/ml/checkpoints
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "print('ok')"]
interval: 60s
timeout: 10s
retries: 3
start_period: 30s
api:
build:
context: ./aware-fund/services/api
container_name: aware-api
depends_on:
clickhouse:
condition: service_healthy
analytics:
condition: service_started
environment:
CLICKHOUSE_HOST: clickhouse
CLICKHOUSE_PORT: 8123
CLICKHOUSE_DATABASE: polybot
API_HOST: 0.0.0.0
API_PORT: 8000
volumes:
# Mount ML checkpoints for drift status endpoint
- ./aware-fund/services/analytics/ml/checkpoints:/app/ml/checkpoints:ro
ports:
- "8000:8000"
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/freshness')"]
interval: 30s
timeout: 10s
retries: 3
# ═══════════════════════════════════════════════════════════════════════════
# WEB DASHBOARD (development mode with hot reload)
# ═══════════════════════════════════════════════════════════════════════════
web:
build:
context: ./aware-fund/services/web
dockerfile: Dockerfile.dev
container_name: aware-web
depends_on:
- api
environment:
NEXT_PUBLIC_API_URL: http://localhost:8000/api # For client-side (browser)
API_INTERNAL_URL: http://api:8000 # For server-side (Next.js rewrites)
ports:
- "3000:3000"
volumes:
# Mount source for hot reload
- ./aware-fund/services/web/src:/app/src:ro
- ./aware-fund/services/web/public:/app/public:ro
# ═══════════════════════════════════════════════════════════════════════════
# MONITORING (optional, comment out to save resources)
# ═══════════════════════════════════════════════════════════════════════════
prometheus:
image: prom/prometheus:v2.48.0
container_name: aware-prometheus
volumes:
- ./deploy/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
ports:
- "9090:9090"
profiles:
- monitoring
grafana:
image: grafana/grafana:10.2.2
container_name: aware-grafana
depends_on:
- prometheus
environment:
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-admin}
GF_USERS_ALLOW_SIGN_UP: "false"
ports:
- "3001:3000"
profiles:
- monitoring
# No Docker volumes - using bind mounts in ./data/ for persistence
networks:
default:
name: aware-local