Hi, i request your help here because i’m in front of a big trouble :
I have 2 services defined in my docker-compose.yml which are typically two website (i’ll call them web1 and web2) web1 need web2 to work.
I WANT to be able to call web1 via web1.local (hostname pointing on 127.0.0.1) and to call web2 via web2.local (hostname pointing on 127.0.0.1).
I DON’T WANT to be obliged to call web1 via web1.local (hostname pointing on 127.0.0.1) and to call web2 via web1.local:8080 (hostname pointing on 127.0.0.1:8080).
I’m also getting crazy with different network configuration and frustrated by the fact that a simple apache server can make it work but not Docker …
no can do… only ONE application can use a port at the same time.
you could use a something like apache or nginx to route a PATH 127.0.0.1/host1 and 172.0.0.1/host2
but you have to provide some different input to select the other app
docker does NOT provide ANY data routing… that is some other apps responsibility
It’s possible. Just have to use some additional software. You could NOT map the ports on to the host and access by ip address (which is what apache or nginx would do)