title: How to join the default bridge network with docker-compose v2?
body: <p>I tried to setup an <a href="https://github.com/jwilder/nginx-proxy" rel="noreferrer">nginx-proxy</a> container to access my other containers via subdomains on port 80 instead of special ports. As you can guess, I could not get it to work.</p>
  
  <p>I'm kind of new to docker itself and found that it's more comfortable for me to write <code>docker-compose.yml</code> files so I don't have to constantly write long <code>docker run ...</code> commands. I thought there's no difference in how you start the containers, either with <code>docker</code> or <code>docker-compose</code>. However, one difference I noticed is that starting the container with <code>docker</code> does not create any new networks, but with <code>docker-compose</code> there will be a <code>xxx_default</code> network afterwards.</p>
  
  <p>I read that containers on different networks cannot access each other and maybe that might be the reason why the nginx-proxy is not forwarding the requests to the other containers. However, I was unable to find a way to configure my <code>docker-compose.yml</code> file to not create any new networks, but instead join the default bridge network like <code>docker run</code> does.</p>
  
  <p>I tried the following, but it resulted in an error saying that I cannot join system networks like this:</p>
  
  <pre><code>networks:
    default:
      external:
        name: bridge
  </code></pre>
  
  <p>I also tried <code>network_mode: bridge</code>, but that didn't seem to make any difference.</p>
  
  <p>How do I have to write the <code>docker-compose.yml</code> file to not create a new network, or is that not possible at all?</p>
  
  <p>Bonus question: Are there any other differences between <code>docker</code> and <code>docker-compose</code> that I should know of?</p>