I am trying to set up a dev environment for my project.
I have a container (ms1) that needs to be placed on its own network ("services" in my case) and a container (apigateway) that needs to access this network while exposing the http port to the host network.
Ideally, my docker build file would look like this:
version: '2' services: ms1: expose: - "13010" networks: services: aliases: - ms1 apigateway: networks: services: aliases: - api network_mode: "host" networks: services:
docker-compose does not allow network_mode and networks to be used simultaneously.
Do I have any other alternatives?
I am currently using this:
apigateway: networks: services: aliases: - api ports: - "127.0.0.1:10000:13010"
and then the apigateway container listens on 0.0.0.0:13010. It works, but it is slow, and it freezes if the connection to the Internet site is down.
In addition, I plan to use the tramp in the future on the docker, does this solve in a clean way?
docker vagrant networking docker-compose devops
phzonta
source share