Add MOODLE_DOCKER_DBHOST
Hello, while working on MDL-69581 I found an unbalanced situation when playing, better jamming, with the Toolbox environment through an external DB server. Indeed we can set the DB credentials via ENV VAR:
MOODLE_DOCKER_DBNAMEMOODLE_DOCKER_DBUSER
but not the DB Host, not strictly required in the Toolbox ecosystem unless when crossing an external DB instance could be a valuable option still for testing purposes.
Does it make sense?
I'd open a PR if it won't hurt adding a new ENV VAR defaulting to db (the service name in the compose file) and mostly unused.
TIA, Matteo
That sounds ok for me, can be useful when testing real databases elsewhere (Azure, AWS...) and also local with special debugging, tracing... +1
Hi @stronk7, here is the proposal:
- the minimum required change: https://github.com/scara/moodle-docker/commit/95b584c07f6fcede76e17ba85d78a835c2aaa03c. The local DB server will be still available and if you keep
MOODLE_DOCKER_DBin sync with the type of the external DB server you'll be able to use it e.g. as the local DB client - the change I doubt to be required: https://github.com/scara/moodle-docker/commit/e0bf9bd9130c2e6c50e49a9b20cec9e227aaecdf. This commit prevents the feature to have even the local DB server available for some use cases like the DB client
My feeling is that (2) would be an option not good for a development toolbox like this one is.
HTH, Matteo
Exactly one year later (Nov 13th!)...
I think that the 1st option is good enough. It allows, any time, to point to another database elsewhere, without touching the "own" one, and easily go back, or use the database CLI to connect to the external instance or whatever.
So +1 to the 1st approach.
Ciao :-)