mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 22:59:58 -07:00
93 lines
2.7 KiB
YAML
93 lines
2.7 KiB
YAML
# BRK multi-container Docker Compose configuration
|
|
|
|
services:
|
|
brk-processor:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: brk:latest
|
|
container_name: brk-processor
|
|
restart: unless-stopped
|
|
volumes:
|
|
# Bitcoin Core data directory (read-only)
|
|
# For access to raw block data
|
|
- ${BITCOIN_DATA_DIR:-/path/to/bitcoin}:/bitcoin:ro
|
|
# BRK data directory for outputs and state (shared with server)
|
|
# Option 1: Use a named volume (default)
|
|
- ${BRK_DATA_VOLUME:-brk-data}:/home/brk/.brk
|
|
# Option 2: Use a bind mount (uncomment and set BRK_DATA_DIR in .env)
|
|
# - ${BRK_DATA_DIR:-./brk-data}:/home/brk/.brk
|
|
environment:
|
|
# Bitcoin Core configuration
|
|
- BITCOINDIR=/bitcoin
|
|
- BLOCKSDIR=/bitcoin/blocks
|
|
|
|
# RPC configuration (required for processor)
|
|
- RPCCONNECT=${BTC_RPC_HOST:-localhost}
|
|
- RPCPORT=${BTC_RPC_PORT:-8332}
|
|
# - RPCCOOKIEFILE=/bitcoin/.cookie
|
|
|
|
# Username/password authentication
|
|
- RPCUSER=${BTC_RPC_USER}
|
|
- RPCPASSWORD=${BTC_RPC_PASSWORD}
|
|
|
|
# BRK configuration
|
|
- BRKDIR=/home/brk/.brk
|
|
- COMPUTATION=${BRK_COMPUTATION:-lazy}
|
|
- FORMAT=${BRK_FORMAT:-raw}
|
|
- FETCH=${BRK_FETCH:-true}
|
|
command:
|
|
- --bitcoindir
|
|
- /bitcoin
|
|
- --brkdir
|
|
- /home/brk/.brk
|
|
- --rpcconnect
|
|
- "${BTC_RPC_HOST:-localhost}"
|
|
- --rpcuser
|
|
- "${BTC_RPC_USER:-bitcoin}"
|
|
- --rpcpassword
|
|
- "${BTC_RPC_PASSWORD:-bitcoin}"
|
|
- --services
|
|
- processor
|
|
healthcheck:
|
|
test: ["CMD", "pgrep", "-f", "brk"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
|
|
brk-server:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: brk:latest
|
|
container_name: brk-server
|
|
restart: unless-stopped
|
|
ports:
|
|
- 7070:3110 # Map host port 7070 to container port 3110
|
|
volumes:
|
|
# BRK data directory (shared with processor)
|
|
# Option 1: Use a named volume (default)
|
|
- ${BRK_DATA_VOLUME:-brk-data}:/home/brk/.brk
|
|
# Option 2: Use a bind mount (uncomment and set BRK_DATA_DIR in .env)
|
|
# - ${BRK_DATA_DIR:-./brk-data}:/home/brk/.brk
|
|
environment:
|
|
# BRK configuration (server doesn't need Bitcoin RPC)
|
|
- BRKDIR=/home/brk/.brk
|
|
- MCP=${BRK_MCP:-true}
|
|
command:
|
|
- --brkdir
|
|
- /home/brk/.brk
|
|
- --services
|
|
- server
|
|
# Note: Server can start without processor, will serve empty data until processor indexes blocks
|
|
healthcheck:
|
|
test: ["CMD", "sh", "-c", "nc -z localhost 3110 || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
volumes:
|
|
brk-data:
|
|
driver: local |