title: How to mount a host directory with docker-compose, with the "~/path/on/host" to be specified when running the host, not in the docker-compose file
body: <p>I'm wondering how you can mount a host directory using docker-compose.</p>
  <p>At the moment I'm just using a regular Dockerfile and it's working fine. When I run the container I just specify the path on my host and the path on the container.</p>
  <pre><code>docker run -d -p 3000:3000 -v ~/path/on/host:/path/on/container my-container
  </code></pre>
  <p>I'd like to to achieve this using docker-compose but I'm not sure how this works.My docker compose is below.</p>
  <pre><code>version: '3'
  
  services:
    my-app:
      build:
        context: .
        dockerfile: ./path/to/Dockerfile
  </code></pre>
  <p>In addition, I need the ~/path/on/host to be specified when running the host, not in the docker-compose file.</p>