1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-27 13:48:49 +08:00

56 lines
1.7 KiB
YAML
Raw Normal View History

# Copyright (c) Mainflux
# SPDX-License-Identifier: Apache-2.0
# This docker-compose file contains optional Prometheus and Grafana service for Mainflux platform.
# Since this service is optional, this file is dependent of docker-compose.yml file
# from <project_root>/docker. In order to run this service, execute command:
# docker-compose -f docker/addons/prometheus/docker-compose.yml up
# from project root.
version: "3.7"
networks:
docker_mainflux-base-net:
external: true
volumes:
mainflux-prometheus-volume:
services:
promethues:
image: prom/prometheus:v2.42.0
container_name: mainflux-prometheus
restart: on-failure
ports:
- ${MF_PROMETHEUS_PORT}:${MF_PROMETHEUS_PORT}
networks:
- docker_mainflux-base-net
volumes:
- type: bind
source: ./metrics/prometheus.yml
target: /etc/prometheus/prometheus.yml
- mainflux-prometheus-volume:/prometheus
grafana:
image: grafana/grafana:8.2.6
container_name: mainflux-grafana
depends_on:
- promethues
restart: on-failure
ports:
- ${MF_GRAFANA_PORT}:${MF_GRAFANA_PORT}
environment:
- GF_SECURITY_ADMIN_USER=${MF_GRAFANA_ADMIN_USER}
- GF_SECURITY_ADMIN_PASSWORD=${MF_GRAFANA_ADMIN_PASSWORD}
networks:
- docker_mainflux-base-net
volumes:
- type: bind
source: ./grafana/datasource.yml
target: /etc/grafana/provisioning/datasources/datasource.yml
- type: bind
source: ./grafana/dashboard.yml
target: /etc/grafana/provisioning/dashboards/main.yaml
- type: bind
source: ./grafana/example-dashboard.json
target: /var/lib/grafana/dashboards/example-dashboard.json