There are many questions like this one, but their solution are mostly "use the service name instead of 127.0.0.1" or similar.
I have two docker-compose.ym
docker-compose.ym