Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
I am having nearly identical issue. If you connect to the nginx container you will find that you cannot resolve external URL from within, it is not using your host DNS. I connect with $docker exec -it container_name /bin/bash
I have not been able to find a way to use docker-compose networking (i.e. linking between containers, depends_on) AND set DNS to access external hosts.
has anyone else solved this?
It could be possible that the containers you are trying to link may not be on the same network.
You could try putting them all on the same network:
services:
example_service_1:
image: example_service_1/image
container_name: example_service_1
...
...
networks:
- example-net
example_service_2:
image: example_service_2/image
container_name: example_service_2
...
...
networks:
- example-net
nginx:
image: nginx
container_name: nginx
ports:
- 80:80
- 443:443
...
...
networks:
- example-net
networks:
example-net:
external: true
Hi there @turkdoktoru,
I believe that the problem is caused by the depends_on directive, currently, your web service depends on the Nginx service, but it has to be the other way around.
You need to have your web service up and running first before bringing up your Nginx service otherwise the Nginx service would fail as it would not find the web service.
Let me know how it goes! Regards, Bobby