title: Mounting a directory to a named volume in Docker
body: <p>I want the source code of my project to be accessible via  a named volume (rather than using bind mount method). But there is a confusion for me, I don't know how should I mount my host directory to a named volume. So, I define a volume in my docker-compose.yml:</p>
  
  <pre><code>volumes:
     appData:
  
  services:
     nginx:
        .
        .
        .
        volumes:
           - appData:/usr/share/data
  </code></pre>
  
  <p>Everything works, but then how should I add my host file to the named volume? And when.</p>