I have following docker-compose.yaml, with this container are unable to discover each other.
services:
uwsgi:
image: uwsgi:latest
restart: always
ports:
- 8000
networks:
- mynetwork
nginx:
image: nginx:latest
restart: always
ports:
- 80:80
volumes:
- /tmp/docker/nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- mynetwork
networks:
mynetwork:
name: mynetwork
I tried this in nginx container
# nslookup uwsgi
Server: 127.0.0.11
Address: 127.0.0.11#53
Non-authoritative answer:
Name: uwsgi
Address: 172.21.0.10
and
# telnet uwsgi 8000
Trying 172.21.0.10...
telnet: Unable to connect to remote host: Connection refused
and
# curl uwsgi:8000
curl: (7) Failed to connect to uwsgi port 8000 after 2 ms: Couldn't connect to server