title: Where is a mysql volume db-data:/var/lib/mysql/data stored?
body: <p>I'm trying to get my head around docker and confused how the volumes work.</p>
  
  <p>On the <a href="https://docs.docker.com/compose/compose-file/" rel="nofollow noreferrer">official documentation</a> there's a bit of code similar to the <code>docker-compose.yml</code> file I'm working with.</p>
  
  <pre><code>version: "3.7"
  
  services:
    wordpress:
      image: wordpress
      ports:
        - "8080:80"
      networks:
        - overlay
      deploy:
        mode: replicated
        replicas: 2
        endpoint_mode: vip
  
    mysql:
      image: mysql
      volumes:
         - db-data:/var/lib/mysql/data
      networks:
         - overlay
      deploy:
        mode: replicated
        replicas: 2
        endpoint_mode: dnsrr
  
  volumes:
    db-data:
  
  networks:
    overlay:
  </code></pre>
  
  <p>I'm confused as to what the <code>db-data:/var/lib/mysql/data</code> refers to and where docker is actually storing the database data, especially as <code>/var/lib/mysql</code> doesn't exist as a directory on the host.</p>