Did you tried setting DB_HOST=db?
As 'db' is the service name for the database then the host name. Or do you have a reason not to use db?
It's also recommended to define a network in your docker compose and tie your containers to this network.