I have a docker-compose file with 3 services like the following
service:
service1-dev:
(filled with the good config)
network :
custom_network
ipv4_address:167.34.0.5
service2-test:
(filled with the good config)
network :
custom_network
ipv4_address:167.34.0.3
service3-request:
(filled with the good config)
network :
custom_network
ipv4_address:167.34.0.2
networks:
custom_network:
driver: bridge
ipam:
config:
- subnet: 167.34.0.0/16
Everything work fine and my service1-dev is running on 0.0.0.0:8081 When my dev container is running i can easily acces it with the following in a browser : http://localhost:8081/test and im receiving my json
The probleme is im running my service3-request that should send some request to my service1-dev but the request are not working.
I don't understand why isn't working both of my container are in the same network 167.34.0.0/16 they both can ping eachother but im trying to do a : curl http://localhost:8081/test error 502
OR
curl http://167.34.0.5:8081/test do nothing
but it doesnt work.
So i don't understand how i can ping all my container but i cannot receive my json when i call my service