I use the container image to run my Dolibarr - which by the way is a great method for running multiple Dolibarr installations, development, testing, staging, and finally production environments.
Anyway, back to the setup. In my container configuration I set these environment variables and that makes Dolibarr know how to talk to the database.
--env DOLI_DB_TYPE
--env DOLI_DB_HOST
--env DOLI_DB_HOST_PORT
--env DOLI_DB_NAME
--env DOLI_DB_USER
--env DOLI_DB_PASSWORD
hope this helps




