# Prometheus Brokers — Smart City Digital Twin Martinique
# Usage: docker compose -f docker-compose.yml -f docker-compose.prometheus.yml up -d
# Scrapes metrics from MQTT brokers, Kafka, Context Brokers, and simulators

networks:
  smartcity-shared:
    external: true
  traefik-public:
    external: true

services:
  prometheus-brokers:
    image: prom/prometheus:latest
    container_name: smart-city-prometheus-brokers
    networks:
      - smartcity-shared
      - traefik-public
    ports:
      - "9090:9090"
    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'
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
      - prometheus_brokers_data:/prometheus
    restart: unless-stopped
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.prometheus-brokers.rule=Host(`prometheus-brokers.digitribe.fr`)"
      - "traefik.http.routers.prometheus-brokers.entrypoints=websecure"
      - "traefik.http.routers.prometheus-brokers.tls.certresolver=letsencrypt"
      - "traefik.http.services.prometheus-brokers.loadbalancer.server.port=9090"

volumes:
  prometheus_brokers_data:
    external: false
    name: smart-city_prometheus_brokers_data
