Use host networking and additional networks in docker compose : <p>I'm trying to set up a dev environment for my project.</p>

<p>I have a container (ms1) which should be put in his own network ("services" in my case), and a container (apigateway) which should access that network while exposing an http port to the host's network.</p>

<p>Ideally my docker compose file would look like this:</p>

<pre><code>version: '2'
services:
    ms1:
        expose:
            - "13010"
        networks:
            services:
                aliases:
                    - ms1
   apigateway:
        networks:
            services:
                aliases:
                    - api
        network_mode: "host"
networks:
    services:
</code></pre>

<p>docker-compose doesn't allow to use network_mode and networks at the same time.</p>

<p>Do I have other alternatives?</p>

<p>At the moment I'm using this:</p>

<pre><code>   apigateway:
        networks:
            services:
                aliases:
                    - api
        ports:
            - "127.0.0.1:10000:13010"
</code></pre>

<p>and then apigateway container listens on 0.0.0.0:13010. It works but it is slow and it freezes if the host's internet connection goes down.</p>

<p>Also, I'm planning on using vagrant in the future upon docker, does it allow to solve in a clean way?</p>
