forked from magicdude4eva/btc-fullnode-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·298 lines (283 loc) · 8.68 KB
/
docker-compose.yml
File metadata and controls
executable file
·298 lines (283 loc) · 8.68 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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
version: "3.9"
networks:
bitcoin:
name: bitcoin
external: true
enable_ipv6: false
# ---------------------------------------------------------------------
# Define Common environment and logging
x-common-env: &default-env
PUID: ${PUID}
PGID: ${PGID}
TZ: ${TZ}
x-common-logging: &common-logging-restart-unless-stopped
restart: unless-stopped
logging:
driver: json-file
options:
max-file: ${DOCKERLOGGING_MAXFILE}
max-size: ${DOCKERLOGGING_MAXSIZE}
# ---------------------------------------------------------------------
services:
# MariaDB - MySQL Database
mariadb:
profiles: ["prod"] # only runs with dev profile
container_name: mariadb
image: lscr.io/linuxserver/mariadb:latest
stop_grace_period: 1m
<<: *common-logging-restart-unless-stopped
networks:
muffinnetwork:
aliases:
- mariadb
bitcoin: {}
ports:
- 8306:3306
labels:
- com.centurylinklabs.watchtower.enable=true
environment:
<<: *default-env
UMASK: "0622"
MARIADB_ROOT_PASSWORD: "mysql"
MARIADB_AUTO_UPGRADE: "true"
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/TZ:/etc/timezone:ro
- ${DOCKERCONFDIR}/mariadb:/config:rw
######################################################################################################
# Bitcoin Mining Configuration
# https://bitcoincore.org/en/releases/
bitcoind:
profiles: ["bitcoin"]
container_name: bitcoin-node
image: bitcoin-core:29.0 # use your built image, or build below
build:
context: ./bitcoin
args:
BITCOIN_VERSION: "29.0" # Pass ARG into Dockerfile
stop_grace_period: 1m
user: "${PUID}:${PGID}"
<<: *common-logging-restart-unless-stopped
networks:
bitcoin:
aliases:
- bitcoind
ports:
- "8332:8332" # RPC
- "8333:8333" # P2P
- "28332:28332" # ZMQ hashblock
- "28333:28333" # ZMQ rawblock
- "28334:28334" # ZMQ rawtx
environment:
<<: *default-env
volumes:
- /etc/localtime:/etc/localtime:ro
- ${DOCKERSTORAGEDIR}/bitcoin:/blocks # HDD-mounted blocks
- ${DOCKERCONFDIR}/bitcoin/bitcoin.conf:/bitcoin/bitcoin.conf # NVMe-mounted config
- ${DOCKERCONFDIR}/bitcoin/bitcoin-data:/bitcoin # NVMe-mounted chainstate, txindex, config
# Bitcoin RPC Explorer
# https://github.com/janoside/btc-rpc-explorer
bitcoin-explorer:
profiles: ["bitcoin"]
container_name: bitcoin-explorer
image: bitcoin-explorer:1.0 # use your built image, or build below
build:
context: ./bitcoin-explorer
<<: *common-logging-restart-unless-stopped
networks:
bitcoin:
aliases:
- bitcoin-explorer
ports:
- "3002:3002"
environment:
<<: *default-env
volumes:
- /etc/localtime:/etc/localtime:ro
- ${DOCKERCONFDIR}/bitcoin-explorer/bitcoin-explorer.conf:/app/.env:ro
# CKPool and Proxy
# https://bitbucket.org/ckolivas/ckpool-solo/src/solobtc/
ckpool:
profiles: ["bitcoin"]
container_name: ckpool
image: ckpool:ckpool-solo # how it will appear locally
build:
context: ./cksolo
depends_on:
- bitcoind
<<: *common-logging-restart-unless-stopped
user: "${PUID}:${PGID}"
networks:
bitcoin:
aliases:
- ckpool
ports:
- "3333:3333" # stratum
- "3334:3334" # proxy (optional)
- "13531:13531" # Optional: CKProxy stats or internal port
environment:
<<: *default-env
volumes:
- /etc/localtime:/etc/localtime:ro
- ${DOCKERCONFDIR}/cksolo/ckpool.conf:/ckpool-conf/ckpool.conf:ro
- ${DOCKERCONFDIR}/cksolo/logs:/logs
# CKStats
# Contains CKStats and PostgresSQL
# https://github.com/mrv777/ckstats
ckstats:
profiles: ["bitcoin"]
container_name: ckstats
image: ckstats-allinone:1.0
build:
context: ./ckstats
depends_on:
- ckpool
<<: *common-logging-restart-unless-stopped
user: "${PUID}:${PGID}"
networks:
bitcoin:
aliases:
- ckstats
ports:
- "4000:3000" # CKStats website
environment:
<<: *default-env
REBUILD_APP: "0" # Set to "1" to rebuild the app and run the migration
DB_REINITIALISE: "0" # Set to "1" to delete the entire database and wipe /ckstats/pgdata/*
volumes:
- /etc/localtime:/etc/localtime:ro
- ${DOCKERCONFDIR}/cksolo/logs:/logs:ro
- ${DOCKERCONFDIR}/ckstats/pgdata:/var/lib/postgresql/data
# https://github.com/cculianu/Fulcrum
fulcrum:
profiles: ["mempool"]
container_name: mempool-fulcrum
image: fulcrum:1.12.0
build:
context: ./fulcrum
args:
FULCRUM_VERSION: "1.12.0"
stop_grace_period: 1m
depends_on:
- bitcoind
<<: *common-logging-restart-unless-stopped
networks:
bitcoin:
aliases:
- fulcrum
environment:
<<: *default-env
volumes:
- /etc/localtime:/etc/localtime:ro
- ${DOCKERCONFDIR}/fulcrum/data:/fulcrum
- ${DOCKERCONFDIR}/fulcrum/fulcrum.conf:/config/fulcrum.conf
######################################################################################################
# Mempool Explorer (Monitoring UI for Bitcoin)
# https://github.com/mempool/mempool/tree/master/docker
mempool-web:
profiles: ["mempool"]
container_name: mempool-web
image: mempool/frontend:v3.2.1
command: "./wait-for mariadb:3306 --timeout=720 -- nginx -g 'daemon off;'"
stop_grace_period: 1m
depends_on:
- mempool-api
<<: *common-logging-restart-unless-stopped
networks:
bitcoin:
aliases:
- mempool-web
ports:
- "9800:8080" # Web UI accessible at http://localhost:8080
environment:
<<: *default-env
FRONTEND_HTTP_PORT: "8080"
BACKEND_MAINNET_HTTP_HOST: "mempool-api"
volumes:
- /etc/localtime:/etc/localtime:ro
- ${DOCKERCONFDIR}/mempool/custom-pools:/var/www/mempool/browser/custom-pools:ro
mempool-api:
profiles: ["mempool"]
container_name: mempool-api
image: mempool/backend:v3.2.1
command: "./wait-for-it.sh mariadb:3306 --timeout=720 --strict -- ./start.sh"
stop_grace_period: 1m
depends_on:
- mariadb
<<: *common-logging-restart-unless-stopped
networks:
bitcoin:
aliases:
- mempool-api
muffinnetwork: {}
environment:
<<: *default-env
MEMPOOL_BACKEND: "electrum"
ELECTRUM_HOST: "mempool-fulcrum"
ELECTRUM_PORT: "50001"
ELECTRUM_TLS_ENABLED: "false"
CACHE_DIR: "/backend/cache"
CORE_RPC_HOST: "bitcoind"
CORE_RPC_PORT: "8332"
CORE_RPC_USERNAME: "${CORE_RPC_USERNAME}"
CORE_RPC_PASSWORD: "${CORE_RPC_PASSWORD}"
DATABASE_ENABLED: "true"
DATABASE_HOST: "mariadb"
DATABASE_DATABASE: "mempool"
DATABASE_USERNAME: "mempool"
DATABASE_PASSWORD: "mempool"
STATISTICS_ENABLED: "true"
volumes:
- /etc/localtime:/etc/localtime:ro
- ${DOCKERCONFDIR}/mempool/cache:/backend/cache
######################################################################################################
# Grafana & Influx DB
# InfluxDB
influxdb:
profiles: ["bitcoin"]
container_name: influxdb
image: influxdb:2.7
<<: *common-logging-restart-unless-stopped
networks:
bitcoin:
aliases:
- influxdb
ports:
- 8086:8086
environment:
<<: *default-env
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: ${INFLUXDB_USERNAME}
DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUXDB_PASSWORD}
DOCKER_INFLUXDB_INIT_ORG: ${INFLUXDB_ORG}
DOCKER_INFLUXDB_INIT_BUCKET: ${INFLUXDB_BUCKET}
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_TOKEN}
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/TZ:/etc/timezone:ro
- ${DOCKERCONFDIR}/influxdb:/var/lib/influxdb2
grafana:
profiles: ["bitcoin"]
container_name: grafana
image: grafana/grafana-oss:latest
networks:
bitcoin:
aliases:
- grafana
depends_on:
- influxdb
ports:
- 3000:3000
environment:
<<: *default-env
GF_INSTALL_PLUGINS: ""
GF_SECURITY_ADMIN_USER: ${GRAFANA_INIT_USERNAME}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_INIT_PASSWORD}
DOCKER_INFLUXDB_INIT_ORG: ${INFLUXDB_ORG}
DOCKER_INFLUXDB_INIT_BUCKET: ${INFLUXDB_BUCKET}
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_TOKEN}
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/TZ:/etc/timezone:ro
- ${DOCKERCONFDIR}/grafana:/var/lib/grafana
- ${DOCKERCONFDIR}/grafana/provisioning/:/etc/grafana/provisioning/