Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current Dockerfiles for MDM and the Postgres database hardcode the database username and password(s) at build time. This means that if a user wants to make any changes to a deployment they have to rebuild both images, something that can be very time-consuming if using buildx (i.e. building on an Apple Silicon machine).
This is also a security risk -- I realise that the intention is that the person building and deploying MDM should enter their credentials in mauro-data-mapper/config/runtime.yml but, as I discovered with our deployment, there's nothing to make them do that. Hardcoding values in files also mean that the Postgres DB is easily accessed if the container file system is ever compromised.
This PR modifies build.yml to replace hardcoded credentials with templated environment variables instead. This means that the credentials are set by defining the corresponding env vars either in a .env file or in the docker-compose file.
It also allows the user to set the host address of the Postgres database -- meaning that users have the option to link the MDM deployment to an existing Postgres DB and are no longer tied into using the packaged one.
The PR also templates the maurodatamapper configuration and the simplejavamail variables, again allowing the user to change settings and redeploy the Compose without having to rebuild the entire container image.
The defaults for the templated environment variables have been added .env and .env.cd
I've verified that this is working and a-ok on my systems but please let me know if there's anything I've missed.
Thanks!
Alex