I have a bridge network in my compose configuration where some containers are set with fixed IP addresses. This works well in that they can see services running on each other etc.
However, when I try and access 127.0.0.1 and a known port that listening from one of these containers, I get connection refused:
nc 127.0.0.1 6379
(UNKNOWN) [127.0.0.1] 6379 (?) : Connection refused
ip route shows:
default via 172.19.2.1 dev eth0
172.19.2.0/24 dev eth0 proto kernel scope link src 172.19.2.8
On host, service is running as shown:
tcp 0 0 localhost:6379 : LISTEN
I need to run some containers on the host network due to redis/sentinel failover detection but not all as I’ll get port conflicts.
Is there anyway I can reach 127.0.0.1?