I have a quite simple docker-compose.yml that creates an initial volume for a mysql container:
version: '3.7'
services:
db:
image: mysql:8.0
volumes:
- database:/var/lib/mysql
volumes:
database:
name: mysql-database
Question: how can I tell docker to create the volume on a specific absolute path on first startup, instead of creating it at /var/lib/docker/volumes/mysql-database/?
I would like to set the target path to /mnt/docker/volumes/mysql-database/ for having it on another disk. But only this volume, not all docker volumes!
Is that possible?