Skip to content

Instantly share code, notes, and snippets.

@jackw
Last active February 2, 2022 14:36
Show Gist options
  • Save jackw/9c7f4388ecbe45c0d5b71d08ca4f1e36 to your computer and use it in GitHub Desktop.
Save jackw/9c7f4388ecbe45c0d5b71d08ca4f1e36 to your computer and use it in GitHub Desktop.
Grafana Docker plugin development with grafana/toolkit and live reload
version: '3.4'
services:
grafana:
container_name: grafana-basic-panel
build: .
ports:
- 3000:3000/tcp
volumes:
- ./dist:/var/lib/grafana/plugins/basic-panel
- ./provisioning:/etc/grafana/provisioning
FROM grafana/grafana:latest
ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin"
ENV GF_AUTH_ANONYMOUS_ENABLED "true"
ENV GF_AUTH_BASIC_ENABLED "false"
ENV GF_ENABLE_GZIP "true"
ENV GF_DEFAULT_APP_MODE "development"
ENV GF_INSTALL_PLUGINS "marcusolsson-static-datasource"
USER root
RUN sed -i 's/<\/body><\/html>/<script src=\"http:\/\/localhost:35729\/livereload.js\"><\/script><\/body><\/html>/g' /usr/share/grafana/public/views/index.html
const LiveReloadPlugin = require("webpack-livereload-plugin");
module.exports.getWebpackConfig = (config, options) => ({
...config,
plugins: [...config.plugins, new LiveReloadPlugin()],
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment