Files
dev/hanzo-node/compose.yml
T
zeekay d9a3368525 Merge origin/main: adopt v0.6.51 version bumps; add Homebrew non-blocking fix
Conflict resolution:
- Accepted remote version bumps to package.json files (0.6.51)
- Kept our workflow fix (Homebrew continue-on-error)
- Included new platform components from parallel agents
2026-01-24 16:04:38 -08:00

145 lines
3.5 KiB
YAML

# Hanzo Node - Docker Compose Configuration
# Production-ready deployment with environment-based configuration
services:
hanzo-node:
build:
context: .
dockerfile: Dockerfile
image: hanzoai/hanzo-node:latest
container_name: hanzo-node
restart: unless-stopped
# Environment configuration
environment:
# Node identity (auto-generated if empty)
- HANZO_NODE_ID=${HANZO_NODE_ID:-}
# Network addresses
- HANZO_GRPC_ADDR=0.0.0.0:9090
- HANZO_HTTP_ADDR=0.0.0.0:8080
- HANZO_P2P_ADDR=/ip4/0.0.0.0/tcp/9000
# Data persistence
- HANZO_DATA_DIR=/app/data
# Network configuration
# 43114 = mainnet, 43113 = testnet, 1337 = local
- HANZO_NETWORK_ID=${HANZO_NETWORK_ID:-1337}
# Bootstrap peers (comma-separated multiaddrs)
- HANZO_BOOTSTRAP_PEERS=${HANZO_BOOTSTRAP_PEERS:-}
# Operator wallet address for staking/rewards
- HANZO_OPERATOR=${HANZO_OPERATOR:-}
# MLX acceleration (macOS only, disabled in container)
- HANZO_MLX=false
# Logging
- HANZO_LOG_LEVEL=${HANZO_LOG_LEVEL:-info}
- RUST_LOG=${RUST_LOG:-hanzo_node=info,tonic=info,libp2p=warn}
# Port mappings
ports:
# RPC/gRPC API - main interface
- "${HANZO_RPC_PORT:-9090}:9090"
# HTTP health check endpoint
- "${HANZO_HTTP_PORT:-8080}:8080"
# P2P networking
- "${HANZO_P2P_PORT:-9000}:9000"
# Persistent storage
volumes:
- hanzo-data:/app/data
- ./config:/app/config:ro
# Health check
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Resource limits
deploy:
resources:
limits:
cpus: "${HANZO_CPU_LIMIT:-4}"
memory: ${HANZO_MEMORY_LIMIT:-4G}
reservations:
cpus: "0.5"
memory: 512M
# Network configuration
networks:
- hanzo-network
# Logging configuration
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
# Optional: Prometheus metrics exporter
prometheus:
image: prom/prometheus:v2.48.0
container_name: hanzo-prometheus
profiles:
- monitoring
restart: unless-stopped
ports:
- "${PROMETHEUS_PORT:-9091}:9090"
volumes:
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.enable-lifecycle'
networks:
- hanzo-network
depends_on:
hanzo-node:
condition: service_healthy
# Optional: Grafana dashboards
grafana:
image: grafana/grafana:10.2.0
container_name: hanzo-grafana
profiles:
- monitoring
restart: unless-stopped
ports:
- "${GRAFANA_PORT:-3000}:3000"
volumes:
- grafana-data:/var/lib/grafana
- ./config/grafana/provisioning:/etc/grafana/provisioning:ro
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-hanzo}
- GF_USERS_ALLOW_SIGN_UP=false
networks:
- hanzo-network
depends_on:
- prometheus
# Named volumes for persistence
volumes:
hanzo-data:
driver: local
prometheus-data:
driver: local
grafana-data:
driver: local
# Network configuration
networks:
hanzo-network:
driver: bridge
ipam:
config:
- subnet: 172.28.0.0/16