title: Volume inside another volume use www-data instead of root
body: <p>I'm using the following Dockerfile/docker-compose.yml. </p>
  
  <p>I'm including the volume "vendor" inside the "/var/www" volume. The "vendor" folder is being created automatically when running the docker-compose file. But it gets created with chown "root:root", while all other folders inside "/var/www" chowned to "www-data:www-data". </p>
  
  <p>Any idea how I can fix it so that the "vendor" volume is also chowned by www-data by default?</p>
  
  <p><strong>Dockerfile</strong></p>
  
  <pre><code>...
  RUN usermod -u 1000 www-data &amp;&amp; groupmod -g 1000 www-data
  ...
  </code></pre>
  
  <p><strong>docker-compose.yml:</strong></p>
  
  <pre><code>volumes:
      - ./:/var/www
      - vendor:/var/www/vendor
  
  volumes:
    vendor:
  </code></pre>
  
  <p><strong>"ls -la" on the "/var/www" shows the following:</strong></p>
  
  <pre><code>drwxr-xr-x 2 www-data www-data    0 Mar 15 20:40 .
  drwxr-xr-x 2 www-data www-data 4096 Mar 15 20:28 ..
  drwxr-xr-x 2 www-data www-data    0 Mar 15 20:42 test
  drwxr-xr-x 2 root     root     4096 Mar 15 20:38 vendor
  </code></pre>