Home > Software engineering >  How to create and mount a volume to a grafana docker image and use it to strore grafana dashbords an
How to create and mount a volume to a grafana docker image and use it to strore grafana dashbords an

Time:08-05

I have created a grafana docker image in aws fargate using aws ecs. The web app works well. However, I loose dashboards and user information anytime I restart the app. From my readings, this is because grafana image has no storage to keep information. How can I add a volume when creating the image and use that volume as a storage system for grafana?

Here is the content of my docker file:

FROM grafana/grafana-enterprise
VOLUME grafana-storage:/var/lib/grafana

CodePudding user response:

Instead of making container have persistent storage one alternative could be to have a custom entrypoint script that downloads the dashboards and put them in /etc/grafana/provisioning/dashboards/ (could be from s3) and then runs /run.sh this way you can keep your container stateless and not add any storage to it.

CodePudding user response:

Configure custom database (e.g. MySQL, PostgreSQL - AWS RDS/Aurora) instead of default file based SQLite DB. RDBs are better for concurrent access, so you can scale out better.

AWS offers also options for backups (e.g. automated snapshosts), so I would say DB is better solution than FS volumes ( problems with FS permissions).

  • Related