Pass Docker Secrets to RELSTORAGE_DSN

Any tips on how to pass your docker secrets file to Plone-backend RELSTORAGE_DSN using the environment keyword in docker-compose.

Am exporting postgress password as a secrets and is available inside the container at '/run/secrets/db_password'.

The default RELSTORAGE_DSN is as follows:
RELSTORAGE_DSN: "dbname='plone' user='plone' host='db' password='plone'"


You can add an .env file, see Declare default environment variables in file | Docker Documentation

1 Like