DEV Community

Berk CAN
Berk CAN

Posted on

2 1

Docker. Communication between Laravel containers

I have a project that I am trying to develop with a microservices approach. I prepared the APIs on two separate microservices and completed their tests. When I send a request from container A to container B, I get the error cURL error 7: Could not connect to localhost port 8100: Connection refused. After my research, I couldn't find a solution.

Address

Top comments (2)

Collapse
 
as0t profile image
as0t

You cannot use localhost to access another container. You should use the container name.

forums.docker.com/t/how-to-communi...

Collapse
 
nrkdrk profile image
Berk CAN

Thanks

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay