my-homelab-configs/infra/blockchain-devnet/docker-compose.yml

59 lines
1.4 KiB
YAML

services:
anvil:
image: ghcr.io/foundry-rs/foundry:latest
container_name: homelab-blockchain-anvil
command:
- anvil
- --host
- 0.0.0.0
- --port
- "8545"
- --chain-id
- "${BLOCKCHAIN_CHAIN_ID:-31337}"
- --block-time
- "${BLOCKCHAIN_BLOCK_TIME:-2}"
- --allow-origin
- "*"
ports:
- "${BLOCKCHAIN_RPC_PORT:-8545}:8545"
restart: unless-stopped
explorer:
image: nginx:1.27-alpine
container_name: homelab-blockchain-explorer
depends_on:
- anvil
ports:
- "${BLOCKCHAIN_EXPLORER_PORT:-8089}:80"
volumes:
- ./explorer:/usr/share/nginx/html:ro
restart: unless-stopped
rpc-gateway:
image: nginx:1.27-alpine
container_name: homelab-blockchain-rpc-gateway
depends_on:
- anvil
ports:
- "${BLOCKCHAIN_RPC_GATEWAY_PORT:-18545}:80"
volumes:
- ./nginx/rpc-gateway.conf:/etc/nginx/conf.d/default.conf:ro
restart: unless-stopped
metrics:
image: python:3.12-alpine
container_name: homelab-blockchain-metrics
depends_on:
- anvil
environment:
BLOCKCHAIN_METRICS_RPC_URL: http://anvil:8545
BLOCKCHAIN_METRICS_PORT: "9109"
ports:
- "${BLOCKCHAIN_METRICS_PORT:-9109}:9109"
volumes:
- ./metrics/exporter.py:/app/exporter.py:ro
command:
- python
- /app/exporter.py
restart: unless-stopped