# {{ project_name }} - Docker Compose Monitoring Stack
# Generated by typedialog-prov-gen

version: '3.8'

services:
  prometheus:
    image: prom/prometheus:latest
    container_name: "{{ project_name }}-prometheus"
    restart: unless-stopped

    ports:
      - "9090:9090"

    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
      - prometheus_data:/prometheus

    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--web.console.libraries=/usr/share/prometheus/console_libraries'
      - '--web.console.templates=/usr/share/prometheus/consoles'

  grafana:
    image: grafana/grafana:latest
    container_name: "{{ project_name }}-grafana"
    restart: unless-stopped

    ports:
      - "3000:3000"

    environment:
      - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
      - GF_USERS_ALLOW_SIGN_UP=false

    volumes:
      - grafana_data:/var/lib/grafana

    depends_on:
      - prometheus

  node_exporter:
    image: prom/node-exporter:latest
    container_name: "{{ project_name }}-node-exporter"
    restart: unless-stopped

    ports:
      - "9100:9100"

    command:
      - '--path.procfs=/host/proc'
      - '--path.sysfs=/host/sys'
      - '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'

    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /:/rootfs:ro

volumes:
  prometheus_data:
    driver: local
  grafana_data:
    driver: local

networks:
  default:
    name: {{ project_name }}_monitoring
