title: How to clone a docker stack on the same server
body: <p>I want to practice using docker-compose.  I have a tournament happening over the weekend and I want to set up 10 copies of the same web app on ONE server with urls like:</p>
  <pre><code>http://team1.example.com
  http://team2.example.com
  etc...
  http://team10.example.com
  </code></pre>
  <p>There will be 10 teams in the tournament, and they will all go to their respective url <code>http://team&lt;your team number&gt;.example.com</code> via web browser, save some information to a database, and maybe even modify the code on the actual server.</p>
  <p>So I built a simple nodejs app that simply writes data to a mongo database.  Then I decided to set up two websites <code>http://team1.example.com</code> and <code>http://team2.example.com</code>. So I made this docker compose file:</p>
  <pre><code>version: '3'
  
  services:
    api1:
      image: dockerjohn/tournament:latest
      environment:
        - DB=database1
      ports:
        - 80:3000
      networks:
        - net1
    db1:
      image: mongo:4.0.3
      container_name: database1
      networks:
        - net1
    api2:
      image: dockerjohn/tournament:latest
      environment:
        - DB=database2
      ports:
        - 81:3000
      networks:
        - net2
    db2:
      image: mongo:4.0.3
      container_name: database2
      networks:
        - net2
  
  networks:
    net1:
    net2:
  
  </code></pre>
  <p>Then I installed apache web server to reverse proxy team 1 to port 80 and team 2 to port 81.  This all works fine.</p>
  <p>To set up the remaining teams 3 to 10, I have to duplicate the entries I have in my docker compose yml file and duplicate virtual host entries in apache.</p>
  <p>My question: Is there a docker command that will let me clone each docker stack (team 1, team2, etc...) more easily without all this data entry?  Do I need Kubernetes to do this?</p>