-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.production.yml
More file actions
214 lines (208 loc) · 6.25 KB
/
docker-compose.production.yml
File metadata and controls
214 lines (208 loc) · 6.25 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
services:
# Genesis Super Node (Block Producer)
qnet-genesis:
build:
context: .
dockerfile: Dockerfile.production
container_name: qnet-genesis
hostname: genesis
logging:
driver: "json-file"
options:
max-size: "10m" # Smaller files for faster log rotation
max-file: "2" # Only 2 files max (20MB total)
compress: "true" # Compress old logs to save space
environment:
- RUST_LOG=info,qnet=debug
- QNET_TESTNET=1
- QNET_FREE_GENESIS_ACTIVATION=1
- QNET_ENABLE_MICROBLOCKS=1
- QNET_DETAILED_LOGGING=1
- QNET_IS_LEADER=1
- QNET_MICROBLOCK_PRODUCER=1
- QNET_PRODUCTION_ENABLED=1
- QNET_SKIP_BURN_CHECK=1
- QNET_NODE_TYPE=super
- QNET_DATA_DIR=/app/data
- QNET_BOOTSTRAP_ID=001
- QNET_GENESIS_BOOTSTRAP=1
- QNET_P2P_PORT=9876
- QNET_API_PORT=8001
- QNET_REGION=na
- DOCKER_ENV=1
command: qnet-node
ports:
- "8001:8001" # Unified API/RPC
- "9876:9876" # P2P network
- "8401:8401" # Metrics (API port + 400)
volumes:
# Use named volume for blockchain data persistence, tmpfs for logs
- genesis-blockchain-data:/app/data/blockchain
# Logs stored in container tmpfs - auto-deleted on container removal
tmpfs:
- /app/data/logs:noexec,nosuid,size=500m
- /app/data/temp:noexec,nosuid,size=200m
networks:
- qnet-testnet
restart: unless-stopped
mem_limit: 4g
cpus: '2.0'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/api/v1/node/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# Validator Node 1 (Full Node)
qnet-validator1:
build:
context: .
dockerfile: Dockerfile.production
container_name: qnet-validator1
hostname: validator1
logging:
driver: "json-file"
options:
max-size: "10m" # Smaller files for faster log rotation
max-file: "2" # Only 2 files max (20MB total)
compress: "true" # Compress old logs to save space
environment:
- RUST_LOG=info,qnet=debug
- QNET_TESTNET=1
- QNET_FREE_GENESIS_ACTIVATION=1
- QNET_ENABLE_MICROBLOCKS=1
- QNET_DETAILED_LOGGING=1
- QNET_FULL_SYNC=1
- QNET_SYNC_ALL_MICROBLOCKS=1
- QNET_SKIP_BURN_CHECK=1
- QNET_NODE_TYPE=full
- QNET_DATA_DIR=/app/data
- QNET_P2P_PORT=9877
- QNET_API_PORT=8001
- QNET_REGION=eu
- DOCKER_ENV=1
command: qnet-node
ports:
- "8002:8001" # Unified API/RPC (mapped to 8002 on host)
- "9877:9877" # P2P network
- "8402:8401" # Metrics (mapped to 8402 on host)
volumes:
# Use named volume for blockchain data persistence, tmpfs for logs
- validator1-blockchain-data:/app/data/blockchain
# Logs stored in container tmpfs - auto-deleted on container removal
tmpfs:
- /app/data/logs:noexec,nosuid,size=500m
- /app/data/temp:noexec,nosuid,size=200m
networks:
- qnet-testnet
restart: unless-stopped
mem_limit: 2g
cpus: '1.0'
depends_on:
- qnet-genesis
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/api/v1/node/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 90s
# Validator Node 2 (Full Node)
qnet-validator2:
build:
context: .
dockerfile: Dockerfile.production
container_name: qnet-validator2
hostname: validator2
logging:
driver: "json-file"
options:
max-size: "10m" # Smaller files for faster log rotation
max-file: "2" # Only 2 files max (20MB total)
compress: "true" # Compress old logs to save space
environment:
- RUST_LOG=info,qnet=debug
- QNET_TESTNET=1
- QNET_FREE_GENESIS_ACTIVATION=1
- QNET_ENABLE_MICROBLOCKS=1
- QNET_DETAILED_LOGGING=1
- QNET_FULL_SYNC=1
- QNET_SYNC_ALL_MICROBLOCKS=1
- QNET_SKIP_BURN_CHECK=1
- QNET_NODE_TYPE=full
- QNET_DATA_DIR=/app/data
- QNET_P2P_PORT=9878
- QNET_API_PORT=8001
- QNET_REGION=asia
- DOCKER_ENV=1
command: qnet-node
ports:
- "8003:8001" # Unified API/RPC (mapped to 8003 on host)
- "9878:9878" # P2P network
- "8403:8401" # Metrics (mapped to 8403 on host)
volumes:
# Use named volume for blockchain data persistence, tmpfs for logs
- validator2-blockchain-data:/app/data/blockchain
# Logs stored in container tmpfs - auto-deleted on container removal
tmpfs:
- /app/data/logs:noexec,nosuid,size=500m
- /app/data/temp:noexec,nosuid,size=200m
networks:
- qnet-testnet
restart: unless-stopped
mem_limit: 2g
cpus: '1.0'
depends_on:
- qnet-genesis
- qnet-validator1
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/api/v1/node/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 120s
# Monitoring Stack
prometheus:
image: prom/prometheus:latest
container_name: qnet-prometheus
ports:
- "9093: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'
networks:
- qnet-testnet
restart: unless-stopped
grafana:
image: grafana/grafana:latest
container_name: qnet-grafana
ports:
- "3000:3000"
volumes:
- grafana-data:/var/lib/grafana
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning
environment:
- GF_SECURITY_ADMIN_PASSWORD=qnet2025
- GF_USERS_ALLOW_SIGN_UP=false
networks:
- qnet-testnet
restart: unless-stopped
networks:
qnet-testnet:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
volumes:
prometheus-data:
grafana-data:
# Named volumes for blockchain data (persistent)
genesis-blockchain-data:
validator1-blockchain-data:
validator2-blockchain-data: