Thank you for your reply. To answer your question about what happens in the service log, it's mostly this over and over again:
ConnectionError: timeout exceeded when trying to connect
at Object.createConnection (/usr/odk/node_modules/slonik/dist/src/factories/createConnection.js:54:23) at Object.createConnection (/usr/odk/node_modules/slonik/dist/src/factories/createConnection.js:54:23)
... until I restart it. Then everything works fine for a while.
To answer your other questions, yes it is happening about once per day, and the entire service is down until I restart it.
We are using a local (same host as the rest of the services in a digital ocean droplet) postgres database docker container (image postgres:9.6) located on the host at /var/lib/postgresql/data in a volume called postgres_data.