services:
  prometheus:
    image: prom/prometheus:v2.53.0
    container_name: genex-prometheus
    restart: unless-stopped
    ports:
      - "9090:9090"
    volumes:
      - ./prometheus:/etc/prometheus
      - prometheus-data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.retention.time=90d'
    networks:
      - genex-net

  grafana:
    image: grafana/grafana:11.1.0
    container_name: genex-grafana
    restart: unless-stopped
    ports:
      - "3030:3000"
    environment:
      GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD:-genex_admin_2024}
      GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /var/lib/grafana/dashboards/genex-chain-operations.json
    volumes:
      - ./grafana/provisioning:/etc/grafana/provisioning
      - ./grafana/dashboards:/var/lib/grafana/dashboards
      - grafana-data:/var/lib/grafana
    networks:
      - genex-net

  alertmanager:
    image: prom/alertmanager:v0.27.0
    container_name: genex-alertmanager
    restart: unless-stopped
    ports:
      - "9093:9093"
    volumes:
      - ./alertmanager:/etc/alertmanager
    command:
      - '--config.file=/etc/alertmanager/alertmanager.yml'
    networks:
      - genex-net

  node-exporter:
    image: prom/node-exporter:v1.8.0
    container_name: genex-node-exporter
    restart: unless-stopped
    ports:
      - "9100:9100"
    networks:
      - genex-net

volumes:
  prometheus-data:
  grafana-data:

networks:
  genex-net:
    external: true
    name: blockchain_genex-net
