Is there a way I can define the value once in the config file and pass them to all my other instances? So define the values once at the job level, and then in the container section of the yml I reference the job vars?
Sadly no because the config doesn’t support any sort of variable interpolation. You can simplify the env var a bit by using a connection URI with username, password, host, and database in a single line instead of using separate environment variables for each thing.
If your purpose here is merely to make things more DRY, I would expect YAML references to work here. Have a look at the Wikipedia page for YAML - it is rather good.