Giter Site home page Giter Site logo

docker-mysql-grafana's Introduction

Docker-MySQL-Grafana

Commands to run separate images for MySQL and Grafana with persistent data are provided below.

WARNING: the -v flag will create the directories if they don't exist on the host machine.

$PWD variable is the directory from which the docker commands are executed.

/volumes/mysql must be created by user before starting mysql docker to avoid permission issues

Folder contents:

  • volumes/grafana: grafana plugins, dashboards and data sources
  • volumes/mysql: all MySQL data

MySQL

If no MySQL-server is installed on the host machine, add the ports so that MySQL-server is accesible by MySQLWorkbench at localhost:3306

If no other image runs in docker, the IP given to MySQL will be 172.17.0.2

docker run -p 3306:3306 --user $(id -u):$(id -g) --name some-mysql -v $PWD/volumes/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:latest

Grafana

docker run -d -p 3000:3000 --name grafana --user $(id -u):$(id -g) -v $PWD/volumes/grafana:/var/lib/grafana grafana/grafana:6.5.0

To install plugins run:

docker exec -u $(id -u) -it grafana grafana-cli plugins install grafana-piechart-panel
docker restart grafana

To embed iframes run the following:

# Replace whole line
docker exec -u root -it grafana sed -i 's/;allow_embedding = false/allow_embedding = true/' /etc/grafana/grafana.ini
# Replace line after occurence
docker exec -u root -it grafana sed -i '/enable anonymous access/{n;s/.*/enabled = true/}' /etc/grafana/grafana.ini

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.