prometheus docker-compose范例

docker-compose-prometheus.yaml

version: "3"
networks:
  monitor:
    driver: bridge
services:
  prometheus-server:
    image: prom/prometheus:latest
    container_name: prometheus-server
    expose:
      - "9090"
    ports:
      - "9090:9090"
    restart: always
    networks:
      - monitor
    ulimits:
      nproc: 65535
      nofile:
        soft: 40000
        hard: 40000
    volumes:
      - "/app/docker_app_data/prometheus_server/prometheus.yml:/etc/prometheus/prometheus.yml"
      - "/app/docker_app_data/prometheus_server/data:/prometheus-data"

  prometheus-alertmanager:
    image: prom/alertmanager:latest
    container_name: prometheus-alertmanager
    depends_on:
      - prometheus-server
    expose:
      - "9093"
    ports:
      - "9093:9093"
    restart: always
    networks:
      - monitor
    ulimits:
      nproc: 65535
      nofile:
        soft: 40000
        hard: 40000
    volumes:
      - "/app/docker_app_data/prometheus_alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml"

  prometheus-node-exporter:
    image: prom/node-exporter:latest
    container_name: prometheus-node-exporter
    depends_on:
      - prometheus-server
    expose:
      - "9100"
    ports:
      - "9100:9100"
    restart: always
    networks:
      - monitor
    ulimits:
      nproc: 65535
      nofile:
        soft: 40000
        hard: 40000

  grafana-server:
    image: grafana/grafana:latest
    container_name: grafana-server
    depends_on:
      - prometheus-server
    expose:
      - "3000"
    ports:
      - "3000:3000"
    restart: always
    networks:
      - monitor
    environment:
      - "GF_SERVER_ROOT_URL=http://grafana.server.name"
      - "GF_SECURITY_ADMIN_PASSWORD=!@#123#@!"
      - "GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource"
    ulimits:
      nproc: 65535
      nofile:
        soft: 40000
        hard: 40000
    volumes:
      - "/app/docker_app_data/grafana_server/data:/var/lib/grafana"

You may also like...

发表评论