docker-compose.yaml files for MySQL and MariaDB with shared volumes

MariaDB

version: '3.1'
services:
  mariadb:
    container_name: mariadb
    restart: always
    image: mariadb
    environment:
      MYSQL_ROOT_PASSWORD: 'test_pass'
      MYSQL_USER: 'test'
      MYSQL_PASS: 'pass'
    ports:
    - "3306:3306"
    volumes:
    - /db/mariadb/mariadb_data:/var/lib/mysql
MySQL
version: '3.1'
services:
  mysql:
    container_name: mysql
    restart: always
    image: mysql
    environment:
      MYSQL_ROOT_PASSWORD: 'test_pass'
      MYSQL_USER: 'test'
      MYSQL_PASS: 'pass'
    ports:
    - "3306:3306"
    volumes:
    - /db/mysql/mysql_data:/var/lib/mysql