version: "2.1" services: db: image: mysql:5.7.39 platform: linux/x86_64 environment: MYSQL_ROOT_PASSWORD: rootpass MYSQL_DATABASE: grafana MYSQL_USER: grafana MYSQL_PASSWORD: password command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb_monitor_enable=all, --max-connections=1001] ports: - 3306 healthcheck: test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] timeout: 10s retries: 10 mysqld-exporter: image: prom/mysqld-exporter environment: - DATA_SOURCE_NAME=root:rootpass@(db:3306)/ ports: - 9104 depends_on: db: condition: service_healthy prometheus: image: prom/prometheus:v2.4.2 volumes: - ./prometheus/:/etc/prometheus/ environment: - VIRTUAL_HOST=prometheus.loc ports: - 909 nginx-proxy: image: jwilder/nginx-proxy ports: - "80:80" volumes: - /var/run/docker.sock:/tmp/docker.sock:ro depends_on: db: condition: service_healthy grafana1: image: grafana/grafana:dev volumes: - ./grafana/provisioning/:/etc/grafana/provisioning/ environment: - VIRTUAL_HOST=grafana.loc - GF_FEATURE_TOGGLES_ENABLE=ngalert - GF_UNIFIED_ALERTING_HA_PEERS=ha-test-unified-alerting_grafana2_1:9094,ha-test-unified-alerting_grafana1_1:9094 - GF_SERVER_ROOT_URL=http://grafana.loc - GF_DATABASE_NAME=grafana - GF_DATABASE_USER=grafana - GF_DATABASE_PASSWORD=password - GF_DATABASE_TYPE=mysql - GF_DATABASE_HOST=db:3306 - GF_DATABASE_MAX_OPEN_CONN=300 - GF_SESSION_PROVIDER=mysql - GF_SESSION_PROVIDER_CONFIG=grafana:password@tcp(db:3306)/grafana?allowNativePasswords=true ports: - 3010:3000 depends_on: db: condition: service_healthy grafana2: image: grafana/grafana:dev volumes: - ./grafana/provisioning/:/etc/grafana/provisioning/ environment: - VIRTUAL_HOST=grafana.loc - GF_FEATURE_TOGGLES_ENABLE=ngalert - GF_UNIFIED_ALERTING_HA_PEERS=ha-test-unified-alerting_grafana2_1:9094,ha-test-unified-alerting_grafana1_1:9094 - GF_SERVER_ROOT_URL=http://grafana.loc - GF_DATABASE_NAME=grafana - GF_DATABASE_USER=grafana - GF_DATABASE_PASSWORD=password - GF_DATABASE_TYPE=mysql - GF_DATABASE_HOST=db:3306 - GF_DATABASE_MAX_OPEN_CONN=300 - GF_SESSION_PROVIDER=mysql - GF_SESSION_PROVIDER_CONFIG=grafana:password@tcp(db:3306)/grafana?allowNativePasswords=true ports: - 3020:3000 depends_on: db: condition: service_healthy