title: How to copy files to a Docker volume and use that volume with docker-compose
body: <ul>
  <li>There is a webservice running in a Docker container.</li>
  <li>This webservice relies on big json files to boot.</li>
  </ul>
  <p>I create a Docker volume to store the json files with <code>docker volume create my-api-files</code>.</p>
  <p>Here is the <code>docker-compose</code> file for the webservice:</p>
  <pre class="lang-yaml prettyprint-override"><code>version: '3'
  
  services:
    my-api:
      image: node:alpine
      expose:
        - ${NODE_PORT}
      volumes:
        - ./:/api
        - my-api-files:/files
      working_dir: /api
      command: npm run start
  
  volumes: 
    my-api-files: 
      external: true
  </code></pre>
  <p><strong>Now, how can I copy the json files to the <code>my-api-files</code> docker volume before to start the the webservice with <code>docker-compose up</code>?</strong></p>