Skip to content Skip to sidebar Skip to footer

Docker-compose Fails To Resolve Service Hostname

Docker documentation says that every container in the same compose file can be accessed from each other by using their service names. This seems to be working for all my containers

Solution 1:

Maybe you should add them a common network.

version:"3"services:lb:image:nginxvolumes:-./conf/nginx:/etc/nginx/conf.d/default.confports:-"8080:80"environment:-NGINX_HOST=foobar.com-NGINX_PORT=80stdin_open:truetty:truenetworks:-common-networkworker1:build:./rel_sync_worker/.stdin_open:truetty:truedepends_on :-broker-lbnetworks:-common-networkworker2:build:./rel_sync_worker/.stdin_open:truetty:truedepends_on :-broker-lbbroker:build:./broker/.ports:-"4444:4444/udp"stdin_open:truetty:truedepends_on:-lbnetwok:networks:common-netwok:driver:overlay

I don't see what else could give you that kind of problem if your lb container is working ofc, maybe your default.conf file isn't correct.

Hope it helps.

Post a Comment for "Docker-compose Fails To Resolve Service Hostname"