title: How to set a path on host for a named volume in docker-compose.yml
body: <p>Example below creates <em>dbdata</em> named volume and references it inside <em>db</em> service:</p>
  
  <pre><code>version: '2'
  services:
    db:
      image: mysql
      volumes:
        - dbdata:/var/lib/mysql
  volumes:
    dbdata:
      driver: local
  </code></pre>
  
  <p>(from <a href="https://stackoverflow.com/a/35675553/4291814">https://stackoverflow.com/a/35675553/4291814</a>)</p>
  
  <p>I can see the path for the volume defaults to:</p>
  
  <p><code>/var/lib/docker/volumes/&lt;project_name&gt;_dbdata</code></p>
  
  <p>My question is how to configure the path on host for the <code>dbdata</code> volume?</p>