version: "3.9"

name: umotu-node

services:
  abci:
    image: ghcr.io/dguang/abci:v0.3.1
    container_name: umotu-abci
    restart: unless-stopped
    networks:
      - umotu-net
    volumes:
      - abci-data:/app/data
    expose:
      - "26658"   # ABCI socket for CometBFT
      - "8080"    # HTTP JSON-RPC shim and /healthz
    ports:
      - "8080:8080"   # Optional: expose RPC to host
    healthcheck:
      test: ["CMD-SHELL", "curl -fsS http://localhost:8080/healthz || exit 1"]
      interval: 10s
      timeout: 3s
      retries: 12

  cometbft:
    image: cometbft/cometbft:v0.38.12
    container_name: umotu-cometbft
    restart: unless-stopped
    depends_on:
      abci:
        condition: service_healthy
    networks:
      - umotu-net
    volumes:
      - cometbft-data:/cometbft
    command: [
      "start",
      "--home", "/cometbft",
      "--proxy_app", "tcp://abci:26658"
    ]
    expose:
      - "26656"   # P2P
      - "26657"   # RPC
    ports:
      - "26657:26657"  # Optional: expose RPC to host
    healthcheck:
      test: ["CMD-SHELL", "curl -fsS http://localhost:26657/health || exit 1"]
      interval: 10s
      timeout: 3s
      retries: 12

volumes:
  abci-data: {}
  cometbft-data: {}

networks:
  umotu-net:
    driver: bridge
