version: "3.8"

services:
  besu:
    image: hyperledger/besu:23.10.0
    container_name: besu-besu-node-0
    restart: unless-stopped
    stop_grace_period: 60s
    volumes:
      - /opt/besu/data:/data
      - /opt/besu/config:/config
      - /opt/besu/keys:/keys:ro
      - /opt/besu/logs:/logs
    ports:
      - "8545:8545"
      - "8546:8546"
      - "30303:30303"
      - "30303:30303/udp"
      - "9545:9545"
    command:
      - --config-file=/config/besu-config.toml
    networks:
      - core

  firefly-core-b:
    image: ghcr.io/hyperledger/firefly:latest
    container_name: firefly-core-b
    depends_on:
      - firefly-postgres-primary
    environment:
      - FIREFLY_NAMESPACE=default
      - FIREFLY_DATABASE_TYPE=postgres
      - FIREFLY_DATABASE_DSN=postgres://firefly:firefly@firefly-postgres-primary:5432/firefly?sslmode=disable
    networks:
      - core

  firefly-postgres-primary:
    image: postgres:15
    container_name: firefly-postgres-primary
    environment:
      - POSTGRES_USER=firefly
      - POSTGRES_PASSWORD=firefly
      - POSTGRES_DB=firefly
    volumes:
      - /opt/firefly/postgres-primary:/var/lib/postgresql/data
    networks:
      - core

  cacti-db-primary:
    image: postgres:15
    container_name: cacti-db-primary
    environment:
      - POSTGRES_USER=cacti
      - POSTGRES_PASSWORD=cacti
      - POSTGRES_DB=cacti
    volumes:
      - /opt/cacti/postgres-primary:/var/lib/postgresql/data
    networks:
      - core

  chainlink-ccip-b:
    image: chainlink/chainlink:latest
    container_name: chainlink-ccip-b
    networks:
      - core

  node-exporter:
    image: prom/node-exporter:latest
    container_name: node-exporter
    network_mode: host
    pid: host
    restart: unless-stopped

  cadvisor:
    image: gcr.io/cadvisor/cadvisor:latest
    container_name: cadvisor
    restart: unless-stopped
    volumes:
      - /:/rootfs:ro
      - /var/run:/var/run:ro
      - /sys:/sys:ro
      - /var/lib/docker/:/var/lib/docker:ro
      - /cgroup:/cgroup:ro
    ports:
      - "8080:8080"

  log-shipper:
    image: grafana/promtail:latest
    container_name: log-shipper
    volumes:
      - /var/log:/var/log
      - /opt/promtail/config.yml:/etc/promtail/config.yml:ro

networks:
  core:
    driver: bridge

