version: "3.4"
services:
  beacon_node:
    image: chainsafe/lodestar:next
    restart: always
    volumes:
      - beacon_node:/data
      - logs:/logs
    env_file: .env
    ports:
      - "9000:9000" # P2P port
    #  - "9596:9596" # REST API port
    command: beacon --dataDir /data --rest --rest.address 0.0.0.0 --metrics --logFile /logs/beacon.log --logFileLevel debug --logFileDailyRotate 5
    # NodeJS applications have a default memory limit of 4GB on most machines.
    # This limit is bit tight for a Mainnet node, it is recommended to raise the limit
    # since memory may spike during certain network conditions.
    environment:
      NODE_OPTIONS: --max-old-space-size=8192

  prometheus:
    build: docker/prometheus
    restart: always
    volumes:
      - "prometheus:/prometheus"

  grafana:
    build: docker/grafana
    restart: always
    ports:
      - "3000:3000"
    volumes:
      - "grafana:/var/lib/grafana"
      - "grafana-dashboards:/dashboards"
    environment:
      GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD}

volumes:
  beacon_node:
  logs:
  prometheus:
  grafana:
  grafana-dashboards:
