.
This commit is contained in:
9
grafana/auto_restart.log
Normal file
9
grafana/auto_restart.log
Normal file
@ -0,0 +1,9 @@
|
||||
Some services (influxdb) use the 'deploy' key, which will be ignored. Compose does not support 'deploy' configuration - use `docker stack deploy` to deploy to a swarm.
|
||||
Removing grafana ...
|
||||
Removing influxdb ...
|
||||
[2A[2K
|
||||
Removing grafana ... [32mdone[0m
|
||||
[2B[1A[2K
|
||||
Removing influxdb ... [32mdone[0m
|
||||
[1BRemoving network grafana_grafana
|
||||
Some services (influxdb) use the 'deploy' key, which will be ignored. Compose does not support 'deploy' configuration - use `docker stack deploy` to deploy to a swarm.
|
||||
16
grafana/auto_restart.sh
Executable file
16
grafana/auto_restart.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd /home/admin/compose/grafana
|
||||
|
||||
response=$(curl --write-out '%{http_code}' --silent --output /dev/null https://grafana.krumel.moe)
|
||||
|
||||
if [[ $response -gt 500 ]] ; then
|
||||
/usr/local/bin/docker-compose -f grafana.compose down > auto_restart.log 2>&1
|
||||
/usr/local/bin/docker-compose -f grafana.compose up -d >> auto_restart.log 2>&1
|
||||
sleep 1m
|
||||
response=$(curl --write-out '%{http_code}' --silent --output /dev/null https://grafana.krumel.moe)
|
||||
if [[ $response -gt 500 ]] ; then
|
||||
echo "Auto Restart of Grafana/InfluxDB did not succeed, Status $response"
|
||||
fi
|
||||
fi
|
||||
|
||||
38
grafana/docker-compose.yaml
Normal file
38
grafana/docker-compose.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
version: '3.3'
|
||||
services:
|
||||
grafana:
|
||||
ports:
|
||||
- '3000:3000'
|
||||
container_name: grafana
|
||||
volumes:
|
||||
- '/srv/docker/grafana/data:/var/lib/grafana'
|
||||
- '/srv/docker/grafana/grafana.ini:/etc/grafana/grafana.ini'
|
||||
image: grafana/grafana:latest
|
||||
# environment:
|
||||
# - GF_INSTALL_PLUGINS=natel-plotly-panel,briangann-gauge-panel,petrslavotinek-carpetplot-panel,neocat-cal-heatmap-panel
|
||||
networks:
|
||||
- grafana
|
||||
restart: unless-stopped
|
||||
|
||||
influxdb:
|
||||
container_name: influxdb
|
||||
ports:
|
||||
- '8086:8086'
|
||||
volumes:
|
||||
- '/srv/docker/influxdb/data:/var/lib/influxdb2'
|
||||
- '/srv/docker/influxdb/config.yml:/etc/influxdb2/config.yml'
|
||||
image: 'influxdb'
|
||||
networks:
|
||||
- grafana
|
||||
restart: unless-stopped
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 4G
|
||||
|
||||
networks:
|
||||
grafana:
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.20.0.0/24
|
||||
|
||||
Reference in New Issue
Block a user