I'm using the following version of Docker on Mac High Sierra ...
localhost:maps davea$ docker-compose --version
docker-compose version 1.25.2, build 698e2846
I have created the below docker-compose.yml file. I would like my MySql volume to persist across bringing up and down my Docker containers ...
version: '3'
services:
mysql:
restart: always
image: mysql:5.7
environment:
MYSQL_DATABASE: 'maps_data'
# So you don't have to use root, but you can if you like
MYSQL_USER: 'chicommons'
# You can use whatever password you like
MYSQL_PASSWORD: 'password'
# Password for root access
MYSQL_ROOT_PASSWORD: 'password'
ports:
- "3406:3406"
volumes:
- my-db:/var/lib/mysql
web:
restart: always
build: ./web
ports: # to access the container from outside
- "8000:8000"
env_file: .env
environment:
DEBUG: 'true'
command: /usr/local/bin/gunicorn maps.wsgi:application -w 2 -b :8000
depends_on:
- mysql
According to here -- Docker-Compose persistent data MySQL, the docker volumes get stored at /var/lib/docker/volumes, but that path doesn't exist on my system ...
localhost:maps davea$ ls /var/lib/docker/volumes
ls: cannot access '/var/lib/docker/volumes': No such file or directory
Where on my system is this MySql volume getting stored?