103 lines
2.4 KiB
YAML
103 lines
2.4 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# NAC节点
|
|
nac-node:
|
|
build:
|
|
context: ..
|
|
dockerfile: nac-deploy/Dockerfile
|
|
image: nac-blockchain/node:latest
|
|
container_name: nac-node
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8545:8545" # HTTP RPC
|
|
- "8546:8546" # WebSocket RPC
|
|
- "30303:30303" # P2P TCP
|
|
- "30303:30303/udp" # P2P UDP
|
|
volumes:
|
|
- nac-data:/data/nac
|
|
- ./config:/data/nac/config:ro
|
|
environment:
|
|
- NAC_NETWORK=mainnet
|
|
- NAC_LOG_LEVEL=info
|
|
- NAC_RPC_HOST=0.0.0.0
|
|
- NAC_RPC_PORT=8545
|
|
- NAC_WS_PORT=8546
|
|
- NAC_P2P_PORT=30303
|
|
healthcheck:
|
|
test: ["CMD", "nac-node", "health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
networks:
|
|
- nac-network
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "100m"
|
|
max-file: "10"
|
|
|
|
# Prometheus监控
|
|
prometheus:
|
|
image: prom/prometheus:latest
|
|
container_name: nac-prometheus
|
|
restart: unless-stopped
|
|
ports:
|
|
- "9090:9090"
|
|
volumes:
|
|
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
- prometheus-data:/prometheus
|
|
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'
|
|
networks:
|
|
- nac-network
|
|
|
|
# Grafana可视化
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
container_name: nac-grafana
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- grafana-data:/var/lib/grafana
|
|
- ./monitoring/grafana/dashboards:/etc/grafana/provisioning/dashboards:ro
|
|
- ./monitoring/grafana/datasources:/etc/grafana/provisioning/datasources:ro
|
|
environment:
|
|
- GF_SECURITY_ADMIN_PASSWORD=admin
|
|
- GF_USERS_ALLOW_SIGN_UP=false
|
|
networks:
|
|
- nac-network
|
|
|
|
# Nginx反向代理
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: nac-nginx
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./nginx/ssl:/etc/nginx/ssl:ro
|
|
depends_on:
|
|
- nac-node
|
|
networks:
|
|
- nac-network
|
|
|
|
volumes:
|
|
nac-data:
|
|
driver: local
|
|
prometheus-data:
|
|
driver: local
|
|
grafana-data:
|
|
driver: local
|
|
|
|
networks:
|
|
nac-network:
|
|
driver: bridge
|