I am trying to create multi-container application (docker-compose) where connection to outside web is going through container which assignment is to monitor the traffic(mitm-proxy).
It would be possible to access other containers through localhost but the container can not connect to outside web without the connection going through container containing monitoring software.
The way to the web from container1 would be:
/-container1-/ => /-container2-/ => www
How can I create such multi-container system with docker-compose?
(I need to monitor traffic going and coming from third-party to the application that I am developing. Also using host for monitoring is not an option even if possible)