docker-compose.yml
version: '3.8'
services:
grafana:
image: grafana/grafana:latest
restart: unless-stopped
user: root
ports:
- 3000:3000
environment:
- TZ=Asia/Shanghai
volumes:
- ./grafana:/var/lib/grafana
docker swarm
version: '3.8'
services:
grafana:
image: grafana/grafana:latest
user: root
ports:
- 3000:3000
environment:
- TZ=Asia/Shanghai
networks:
- capital_overlay_network
volumes:
- "grafana_data:/var/lib/grafana"
volumes:
grafana_data:
driver: local
driver_opts:
type: "nfs"
o: "addr=10.0.0.58,rw"
device: ":/grafana"
networks:
capital_overlay_network:
driver: overlay