Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
227 lines (216 loc) · 5.34 KB
/
Copy pathdocker-compose.yml
File metadata and controls
227 lines (216 loc) · 5.34 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
version: '3.8'
services:
# QuDAG Node 1 - Bootstrap node
qudag-node-1:
build:
context: .
dockerfile: Dockerfile
container_name: qudag-node-1
hostname: qudag-node-1
restart: unless-stopped
environment:
- NODE_ID=node-1
- QUDAG_P2P_PORT=4001
- QUDAG_RPC_PORT=8080
- QUDAG_METRICS_PORT=9090
- RUST_LOG=info,qudag=debug
- BOOTSTRAP_MODE=true
ports:
- "4001:4001" # P2P
- "8080:8080" # RPC
- "9090:9090" # Metrics
volumes:
- node1-data:/data
- node1-config:/config
- node1-keys:/keys
- ./configs/node1.toml:/config/node.toml:ro
networks:
qudag-network:
ipv4_address: 172.20.0.10
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# QuDAG Node 2
qudag-node-2:
build:
context: .
dockerfile: Dockerfile
container_name: qudag-node-2
hostname: qudag-node-2
restart: unless-stopped
depends_on:
- qudag-node-1
environment:
- NODE_ID=node-2
- QUDAG_P2P_PORT=4001
- QUDAG_RPC_PORT=8080
- QUDAG_METRICS_PORT=9090
- RUST_LOG=info
- BOOTSTRAP_PEERS=/dns4/qudag-node-1/tcp/4001
ports:
- "4002:4001" # P2P
- "8081:8080" # RPC
- "9091:9090" # Metrics
volumes:
- node2-data:/data
- node2-config:/config
- node2-keys:/keys
- ./configs/node2.toml:/config/node.toml:ro
networks:
qudag-network:
ipv4_address: 172.20.0.11
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# QuDAG Node 3
qudag-node-3:
build:
context: .
dockerfile: Dockerfile
container_name: qudag-node-3
hostname: qudag-node-3
restart: unless-stopped
depends_on:
- qudag-node-1
environment:
- NODE_ID=node-3
- QUDAG_P2P_PORT=4001
- QUDAG_RPC_PORT=8080
- QUDAG_METRICS_PORT=9090
- RUST_LOG=info
- BOOTSTRAP_PEERS=/dns4/qudag-node-1/tcp/4001
ports:
- "4003:4001" # P2P
- "8082:8080" # RPC
- "9092:9090" # Metrics
volumes:
- node3-data:/data
- node3-config:/config
- node3-keys:/keys
- ./configs/node3.toml:/config/node.toml:ro
networks:
qudag-network:
ipv4_address: 172.20.0.12
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Prometheus for metrics collection
prometheus:
image: prom/prometheus:latest
container_name: qudag-prometheus
restart: unless-stopped
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
- '--web.enable-lifecycle'
ports:
- "9093:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
networks:
- qudag-network
depends_on:
- qudag-node-1
- qudag-node-2
- qudag-node-3
# Grafana for visualization
grafana:
image: grafana/grafana:latest
container_name: qudag-grafana
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource
ports:
- "3000:3000"
volumes:
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana-data:/var/lib/grafana
networks:
- qudag-network
depends_on:
- prometheus
# Redis for caching and pub/sub
redis:
image: redis:7-alpine
container_name: qudag-redis
restart: unless-stopped
command: redis-server --appendonly yes --requirepass qudag_redis_password
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- qudag-network
# PostgreSQL for persistent storage
postgres:
image: postgres:16-alpine
container_name: qudag-postgres
restart: unless-stopped
environment:
- POSTGRES_DB=qudag
- POSTGRES_USER=qudag
- POSTGRES_PASSWORD=qudag_secure_password
- PGDATA=/var/lib/postgresql/data/pgdata
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
networks:
- qudag-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U qudag"]
interval: 10s
timeout: 5s
retries: 5
# NGINX reverse proxy and load balancer
nginx:
image: nginx:alpine
container_name: qudag-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
networks:
- qudag-network
depends_on:
- qudag-node-1
- qudag-node-2
- qudag-node-3
networks:
qudag-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
volumes:
# Node data volumes
node1-data:
node1-config:
node1-keys:
node2-data:
node2-config:
node2-keys:
node3-data:
node3-config:
node3-keys:
# Service volumes
prometheus-data:
grafana-data:
redis-data:
postgres-data: