title: How I can group containers in docker-compose?
body: <p>I'm using this docker-compose.yml.
  And I wanna make simpler and inherrit configuration, if its possible.</p>
  
  <pre><code>version: '2'
  
  services:
      nginx-proxy:
          image: jwilder/nginx-proxy
          container_name: nginx-proxy
          ports:
              - "80:80"
          volumes:
              - /var/run/docker.sock:/tmp/docker.sock:ro
  
      web_one:
          container_name: "web_one"
          build:
              context: ./
              dockerfile: web.docker
          volumes:
              - ./../one:/var/www
  
          environment:
              - VIRTUAL_HOST=whoami_one.local
          links:
              - app_one
      app_one:
          container_name: "app_one"
          build:
              context: ./
              dockerfile: app.docker
          volumes:
              - ./../one:/var/www
          links:
              - db
  
  
      web_two:
          container_name: "web_two"
          build:
              context: ./
              dockerfile: web.docker
          volumes:
              - ./../two:/var/www
  
          environment:
              - VIRTUAL_HOST=whoami_two.local
          links:
              - app_two
      app_two:
          container_name: "app_two"
          build:
              context: ./
              dockerfile: app.docker
          volumes:
              - ./../two:/var/www
          links:
              - db
  </code></pre>
  
  <p>I have 15 sites with same configuration.
  Can I make config simpler? Like this:</p>
  
  <pre><code>version: '2'
  
  services:
      nginx-proxy:
          image: jwilder/nginx-proxy
          container_name: nginx-proxy
          ports:
              - "80:80"
          volumes:
              - /var/run/docker.sock:/tmp/docker.sock:ro
  
      one:
          extends:
              file: common-services.yml
          volumes:
              - ./../one:/var/www
  
          environment:
              - VIRTUAL_HOST=whoami_one.local
  
      two:
          extends:
              file: common-services.yml
          volumes:
              - ./../two:/var/www
  
          environment:
              - VIRTUAL_HOST=whoami_two.local
  </code></pre>
  
  <p>Or better?</p>
  
  <p>Thank you!</p>