-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
205 lines (195 loc) · 5.23 KB
/
Copy pathdocker-compose.yml
File metadata and controls
205 lines (195 loc) · 5.23 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
version: '3.8'
services:
# Matreshka Core System - Production Ready
matreshka-core:
build:
context: .
target: production
args:
- NODE_ENV=production
image: matreshka-arbitrage:2.0.0
container_name: matreshka-core
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- LOG_LEVEL=info
- DEMO_MODE=true
- WEB_PORT=3000
- REDIS_HOST=redis
- REDIS_PORT=6379
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=matreshka
- DB_USER=matreshka
- DB_PASSWORD=matreshka
- HUMMINGBOT_HOST=hummingbot-gateway
- HUMMINGBOT_PORT=8080
# Security settings
- RATE_LIMIT_WINDOW=900000
- RATE_LIMIT_MAX_REQUESTS=1000
# Performance settings
- HEALTH_CHECK_INTERVAL=30000
- PERFORMANCE_LOG_INTERVAL=300000
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
volumes:
- ./logs:/app/logs:rw
- ./config:/app/config:ro
- ./data:/app/data:rw
restart: unless-stopped
networks:
- matreshka-network
deploy:
resources:
limits:
memory: 2G
cpus: '1.0'
reservations:
memory: 1G
cpus: '0.5'
healthcheck:
test: ["CMD", "node", "dist/index.js", "--health-check"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Hummingbot Gateway
hummingbot-gateway:
image: hummingbot/gateway:latest
ports:
- "8080:8080"
environment:
- GATEWAY_PASSPHRASE=your-secure-passphrase
- GATEWAY_PORT=8080
volumes:
- ./hummingbot-gateway/conf:/home/hummingbot/gateway/conf
- ./hummingbot-gateway/logs:/home/hummingbot/gateway/logs
restart: unless-stopped
networks:
- matreshka-network
# Hummingbot Instance 1 (Maker)
hummingbot-maker:
image: hummingbot/hummingbot:latest
environment:
- CONFIG_FILE_NAME=dman_strategy_config.yml
- TEMPLATE=dman_v2
volumes:
- ./hummingbot-instances/maker/conf:/home/hummingbot/conf
- ./hummingbot-instances/maker/data:/home/hummingbot/data
- ./hummingbot-instances/maker/logs:/home/hummingbot/logs
depends_on:
- hummingbot-gateway
restart: unless-stopped
networks:
- matreshka-network
# Hummingbot Instance 2 (Taker)
hummingbot-taker:
image: hummingbot/hummingbot:latest
environment:
- CONFIG_FILE_NAME=dman_taker_config.yml
- TEMPLATE=dman_v2
volumes:
- ./hummingbot-instances/taker/conf:/home/hummingbot/conf
- ./hummingbot-instances/taker/data:/home/hummingbot/data
- ./hummingbot-instances/taker/logs:/home/hummingbot/logs
depends_on:
- hummingbot-gateway
restart: unless-stopped
networks:
- matreshka-network
# Redis for caching and inter-service communication
redis:
image: redis:7-alpine
container_name: matreshka-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
restart: unless-stopped
networks:
- matreshka-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
# PostgreSQL for persistent data
postgres:
image: postgres:15-alpine
container_name: matreshka-postgres
environment:
- POSTGRES_DB=matreshka
- POSTGRES_USER=matreshka
- POSTGRES_PASSWORD=matreshka
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql:ro
restart: unless-stopped
networks:
- matreshka-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U matreshka -d matreshka"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
deploy:
resources:
limits:
memory: 1G
cpus: '0.5'
# Grafana for monitoring
grafana:
image: grafana/grafana:latest
ports:
- "3001:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana:/etc/grafana/provisioning
depends_on:
- prometheus
restart: unless-stopped
networks:
- matreshka-network
# Prometheus for metrics collection
prometheus:
image: prom/prometheus:latest
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
restart: unless-stopped
networks:
- matreshka-network
volumes:
redis_data:
postgres_data:
grafana_data:
prometheus_data:
networks:
matreshka-network:
driver: bridge