At the root of the project is the docker-compose.yum file :
version: '3.5' services: db: container_name: my_db image: mysql ports: - "3306:3306" volumes: - "mysql:/var/lib/mysql" environment: MYSQL_ROOT_PASSWORD: 12345 MYSQL_DATABASE: test MYSQL_USER: vlad MYSQL_PASSWORD: 12345 volumes: mysql: After docker-compose up -d --build , a corresponding volume is created on the host in the directory: / var / lib / docker / volumes /
Question: How can I change this default address to my own? Those. I want this volume to be created not by the address / var / lib / docker / volumes / , but by the address, for example, / home / vlad / my_project / mysql . I want to store all project files in one place!