version: '3'

services:
  prometheus:
    image: prom/prometheus:v2.15.1
    container_name: "prometheus"
    logging:
      options:
        max-size: "1g"
    networks:
      - "prometheusnet"
    volumes:
      - ./prometheus/work:/prometheus
      - ./prometheus/etc:/etc/prometheus
    ports:
      - 9999:9090
    command: 
      - --web.enable-lifecycle
      - --config.file=/etc/prometheus/prometheus.yml
  alertmanager: 
    image: prom/alertmanager:v0.20.0
    container_name: "alertmanager"
    logging:
      options:
        max-size: "1g"
    networks:
      - "prometheusnet"
    volumes:
      - ./alertmanager/work:/alertmanager
      - ./alertmanager/etc:/etc/alertmanager
    ports:
      - 9093:9093
  grafana: 
    image: grafana/grafana:6.1.4
    container_name: "grafana"
    logging:
      options:
        max-size: "1g"
    networks:
      - "prometheusnet"
    volumes: 
      - ./grafana/lib:/var/lib/grafana
      - ./grafana/logs:/var/log/grafana
    environment: 
      GF_SECURITY_ADMIN_PASSWORD: 123456
    ports:
      - 3000:3000

networks: 
  prometheusnet: 
    driver: bridge