opensafely-core / sysadmin

Various scripts and tools for administering OpenSAFELY organisation and infrastructure
0 stars 0 forks source link

SPIKE How do we setup self-hosted Grafana to use a postgres db? #146

Closed lucyb closed 8 months ago

lucyb commented 9 months ago

By default, Grafana uses a sqlite db for storing its data. This works great while testing, but in production we should use something else.

Using postgres as our database would mean our dokku webservers don't hold any state and would give us automatic backups, as our Digital Ocean postgres cluster already has backups set.

madwort commented 8 months ago

I think this is just the block https://github.com/opensafely-core/job-server/pull/3578/files#diff-89fafc265c1fa601cf2364b20be83308031335fda9467fcf3249d5ec1c0c8172R18-R23

I think we can pass these in with dokku config:set - see environment variables

madwort commented 8 months ago

Nb. I think Grafana would also want to persist some files to disk, but in my local Grafana I've been experimenting with, they don't seem to contain much of value.

Image

lucyb commented 8 months ago

I think this is done and working now, so can be closed.