-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
185 lines (174 loc) · 5.46 KB
/
docker-compose.yml
File metadata and controls
185 lines (174 loc) · 5.46 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
version: '3.8'
services:
# ============================================================================
# Core Services
# ============================================================================
# Redis for distributed locks and caching
redis:
image: redis:7-alpine
container_name: arbitrage-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 3s
retries: 5
environment:
- TZ=UTC
# Ollama for local LLM inference
ollama:
image: ollama/ollama:latest
container_name: arbitrage-ollama
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
environment:
- OLLAMA_HOST=0.0.0.0:11434
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:11434/api/tags" ]
interval: 10s
timeout: 5s
retries: 5
# ============================================================================
# APM and Observability Services (Issue #42)
# ============================================================================
# Jaeger for distributed tracing
jaeger:
image: jaegertracing/all-in-one:latest
container_name: arbitrage-jaeger
environment:
- COLLECTOR_OTLP_ENABLED=true
- COLLECTOR_OTLP_HOST_PORT=0.0.0.0:4317
- SPAN_STORAGE_TYPE=badger
- BADGER_EPHEMERAL=false
- BADGER_DIRECTORY_VALUE=/badger/data
- BADGER_DIRECTORY_KEY=/badger/key
ports:
- "6831:6831/udp" # Jaeger agent (compact thrift)
- "14250:14250" # Jaeger gRPC
- "14268:14268" # Jaeger HTTP collector
- "16686:16686" # Jaeger UI (accessible at http://localhost:16686)
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
volumes:
- jaeger_data:/badger
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:16686/api/traces" ]
interval: 10s
timeout: 5s
retries: 5
command:
- --sampling.strategies-file=/etc/jaeger/sampling_strategies.json
networks:
- arbitrage-network
# Prometheus for metrics collection
prometheus:
image: prom/prometheus:latest
container_name: arbitrage-prometheus
ports:
- "9090:9090"
volumes:
- ./docker/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=30d'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
environment:
- TZ=UTC
healthcheck:
test: [ "CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:9090/-/healthy" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- arbitrage-network
# Grafana for visualization and dashboards
grafana:
image: grafana/grafana:latest
container_name: arbitrage-grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_SECURITY_ADMIN_USER=admin
- GF_INSTALL_PLUGINS=grafana-piechart-panel
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
volumes:
- grafana_data:/var/lib/grafana
- ./docker/grafana/provisioning:/etc/grafana/provisioning
- ./docker/grafana/dashboards:/etc/grafana/provisioning/dashboards
depends_on:
- prometheus
healthcheck:
test: [ "CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/api/health" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- arbitrage-network
# OpenTelemetry Collector (optional, for advanced scenarios)
otel-collector:
image: otel/opentelemetry-collector-contrib:latest
container_name: arbitrage-otel-collector
command: [ "--config=/etc/otel-collector-config.yml" ]
volumes:
- ./docker/otel-collector-config.yml:/etc/otel-collector-config.yml
ports:
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
- "8889:8889" # Prometheus exporter metrics
- "8888:8888" # Metrics listening endpoint
depends_on:
- jaeger
environment:
- TZ=UTC
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:13133" ]
interval: 10s
timeout: 5s
retries: 5
networks:
- arbitrage-network
# ============================================================================
# Application Container (placeholder for FastAPI)
# ============================================================================
# Uncomment when ready to run FastAPI in Docker
# fastapi:
# build:
# context: .
# dockerfile: Dockerfile
# container_name: arbitrage-fastapi
# ports:
# - "8000:8000"
# environment:
# - ENVIRONMENT=production
# - APM_ENABLED=true
# - APM_BACKEND=jaeger
# - JAEGER_ENDPOINT=http://jaeger:14268/api/traces
# - DATABASE_URL=postgresql://user:password@postgres:5432/arbitrage_ai
# - REDIS_URL=redis://redis:6379/0
# - OLLAMA_URL=http://ollama:11434/v1
# depends_on:
# - redis
# - ollama
# - jaeger
# - prometheus
# networks:
# - arbitrage-network
volumes:
redis_data:
ollama_data:
jaeger_data:
prometheus_data:
grafana_data:
networks:
arbitrage-network:
driver: bridge