Dogfooding it, Pt 5 - PostgreSQL
Since I'll now be using configuration files rather heavily, it's probably a good idea to make those available for download. And, in the spirit of self-hosting things, why put them on GitHub when I can host Gitea and show off another service?
Now, I know Gitea could use MySQL as database backend, but I would personally prefer to limit use of that as much as possible. Postgres is my prerred DB engine, and now I have an excuse to deploy it.
So, append to our docker-compose:
Add the following to the secrets section at the head of the file:
postgres-root:
file: /home/<your user>/secrets/postgres-root
And generate the secrets file and the storage location for the postgres database::
$ pwgen > ~/secrets/postgres-root
$ mkdir -p /srv/data/docker/postgres/data
$ chown -R 10003:10003 /srv/data/docker/postgres
$ chmod -R g-rwx,o-rwx /srv/data/docker/postgres
And bring the stack up.
$ docker stack deploy -c <compose-file> --prune homelab