title: Set up Visual Studio Code with multiple containers
body: <p>I have an application consisting of a Flask <code>web</code> application and a RQ <code>worker</code> application. Both live in separate containers but use the same image. I would like to use Visual Studio Code's Remote Extension to run the containers and debug inside them. This all works well for either container using <code>devcontainer.json</code> and the automatically generated <code>.devcontainer/docker-compose.yml</code> which overwrite mine partially.</p>
  <p><a href="https://code.visualstudio.com/remote/advancedcontainers/connect-multiple-containers" rel="nofollow noreferrer">This Article</a> explains that connecting to multiple containers is possible using multiple windows. They assume the two containers to have different source, stored in different folders which can be used to store separate <code>devcontainer.json</code> files.</p>
  <p>I don't understand though how to configure the startup. When starting any of the two containers I would need the other one to start as well. That's easily achieved using the original <code>docker-compose.yml</code>. I could then manually run and debug the application in the started devcontainer.</p>
  <p>Yet how would I connect to the other, then also running container and run and debug there?</p>