When I'm developing locally I'm connecting to the same db server from my laptop via ssh tunnel and want to set the dbhost in the docker-compose to the IP of the docker host (so that I don't have to create extra db containers and import a huge database), which seems to be a real problem.
I started a new project where in docker-compose file (with defines its own bridge network, so no host net) the following entry is used to set database server dbhost in a container: