IzakMarais / reporter

Service that generates a PDF report from a Grafana dashboard
Apache License 2.0
963 stars 309 forks source link

When running this in Docker, where should templates go? #280

Open benkokes opened 3 years ago

benkokes commented 3 years ago

Hello,

When running this in a docker container, can you give guidance how to link in a custom template? I am having trouble finding the correct volume mapping configuration.

Thank you!

benkokes commented 3 years ago

Looks like I needed to hammer on it just a little bit more..

My setup: Docker running on a synology NAS. Grafana running. SSH into whatever is running your docker as SU (super user). I keep all of my docker stuff in the directory /volume1/docker, but I created a /templates directory, so my final path looks like '/volume1/docker/grafana/templates'. place your created tester.tex template there. when you start your docker container in the command line environment, use the following command: 'docker run --name=grafana_reporter1 -d -p YourIPWhereDockerIsRunning:8686:8686 --net="host" -v /volume1/docker/grafana/templates:/templates izakmarais/grafana-reporter'

(the -d means the container runs in detached state, which frees up your command line. If you want debug feedback to see if your template is running correctly, omit this option)

Then in a web browser, type in: 'http://YourIPWhereDockerIsRunning:8686/api/v5/report/YOUR_GRAPH_ID?apitoken=YOUR_API_TOKEN_FROM_GRAFANA&from=now-1d&template=tester'

YOUR_GRAPH_ID should look something short and alphanumeric. IzakMarais shows this in his readme. YOUR_API_TOKEN_FROM_GRAFANA should look something long and alphanumeric. IzakMarais shows this in his readme/