docker-compose.yml
version: "3.5"

services:
  grafana:
    container_name: grafana
    restart: unless-stopped
    depends_on:
      - traefik
    image: grafana/grafana:latest
    user: "root"
    #user: "104"
    volumes:
      - "./grafana:/var/lib/grafana"
    networks:
      - proxy
    environment:
    #username is "admin"
      GF_SECURITY_ADMIN_PASSWORD: "your-own-startup-admin-password"
      GF_INSTALL_PLUGINS: "grafana-simple-json-datasource,grafana-worldmap-panel,grafana-clock-panel,grafana-piechart-panel"
      GF_USERS_ALLOW_SIGN_UP: "false"
      GF_SERVER_DOMAIN: "dashboard.example.com"
      GF_SERVER_ROOT_URL: "https://dashboard.example.com"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.grafana.rule=Host(`dashboard.example.com`)"
      - "traefik.http.routers.grafana.entrypoints=websecure"
      - "traefik.http.routers.grafana.tls.certresolver=myresolver"   
networks:
  proxy:
    external: true