title: Mounting host volume for mongo data in docker compose container
body: <p>I'd like to run mongo in a docker container, alongside some others I'm using via docker-compose.</p>
  
  <p>I thought mounting the volume like so would allow for it to persist data outside the container:</p>
  
  <pre><code>db:
    image: mongo
    command: -smallfiles -nojournal
    volumes:
      - ./mongo_data:/data
  </code></pre>
  
  <p>It seems to create some directories, but there's no files on the host mount. The data files are present on the container.</p>
  
  <pre><code>$ find mongo_data
  mongo_data
  mongo_data/configdb
  mongo_data/db
  </code></pre>