version: "3.3" services: grafana: image: grafana/grafana:8.1.3 restart: unless-stopped expose: - "3000" networks: - web - monitoring labels: - "traefik.enable=true" - "traefik.http.routers.monitoring.rule=Host(`monitoring.${DOMAIN}`)" - "traefik.http.routers.monitoring.entrypoints=web" - "traefik.http.services.monitoring.loadbalancer.server.port=3000" - "traefik.docker.network=web" - "docker.group=monitoring" environment: - GF_DEFAULT_INSTANCE_NAME=monitoring.${DOMAIN} - GF_SERVER_ROOT_URL=http://monitoring.${DOMAIN} - GF_SERVER_DOMAIN=monitoring.${DOMAIN} - GF_SERVER_SERVE_FROM_SUB_PATH=true - GF_SECURITY_DISABLE_GRAVATAR=true - GF_AUTH_ANONYMOUS_ENABLED=true - GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer - GF_DATABASE_TYPE=postgres - GF_DATABASE_HOST=grafanadb:5432 - GF_DATABASE_SSL_MODE=disable - GF_DATABASE_NAME=grafana - GF_DATABASE_USER=${POSTGRES_USER} - GF_DATABASE_PASSWORD=${POSTGRES_PASSWORD} - GF_INSTALL_PLUGINS=flant-statusmap-panel depends_on: - influxdb - grafanadb grafanadb: image: postgres:13 volumes: - ${VOLUMES_PATH}/grafanadb:/var/lib/postgresql/data networks: - monitoring restart: unless-stopped environment: - POSTGRES_DB=grafana - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} labels: - "docker.group=monitoring" influxdb: image: influxdb:1.8 restart: unless-stopped networks: - web - monitoring environment: - INFLUXDB_MONITOR_STORE_ENABLED=false volumes: - ${VOLUMES_PATH}/influxdb/:/var/lib/influxdb - ${PWD}/influxdb.conf:/etc/influxdb/influxdb.conf:ro labels: - "traefik.enable=true" - "traefik.http.routers.influxdb.rule=Host(`influxdb.${DOMAIN}`)" - "traefik.http.routers.influxdb.entrypoints=web" - "traefik.http.services.influxdb.loadbalancer.server.port=8086" - "traefik.docker.network=web" - "docker.group=monitoring" networks: monitoring: web: external: true dockersocket: external: true