title: Docker access localhost port from container
body: <p>I have a container running a Nuxt.js (Vue.js) app, defined by <code>docker_composes.yml</code>:</p>
  
  <pre><code>version: '3'
  services:
    vue:
      build: .
      image: registry.gitlab.com/something/app:${TAG}
      environment:
        - apiPath="http://localhost:5000/"
        - filePath="http://localhost:3000/"
      ports:
       - "${EXPOSED_PORT:-80}:${NUXT_PORT:-3000}"
      restart: always
  </code></pre>
  
  <p>The app is a frontend. I am running the backend on localhost, on port <code>5000</code>.
  When the containerized app tries to connect to <code>http://localhost:5000/</code> it fails. </p>
  
  <p>What are my options?
  I don't want to put the backend into the <code>docker_composes.yml</code> and connect them by link. If it's the only option though, I will.</p>