title: docker-compose: port forward localhost:80 inside a docker container to host port 80
body: <p>I have a situation where I need to let several jobs inside a single docker container orchestrated by docker-compose 1.16.1 communicate with a legacy system.</p>
  
  <p>The legacy system runs in a vagrant box on the same host and binds to three ports (7880, 58608, and 58709).   I understand that the default configuration of docker allows accessing the host as 172.17.0.1, but for obscure technical reasons due to network differences I need the host port available on "localhost". </p>
  
  <p>So, how do I make "localhost port 7880" as seen from inside the docker container port forward to the host port 7880?</p>
  
  <p>I have full control of the docker instance and invocation.</p>