This is a short instructions how to run #mariadb with #docker official image with docker compose and have suitable developer env. Let’s have follow docker-compose.yml
Optionally you can define database with config file - here is mine ./etc/mysql.ini:
Initializing a fresh instance
When a container is started for the first time, a new database with the specified name will be created and initialized with the provided configuration variables. Furthermore, it will execute files with extensions.sh,.sql,.sql.gz,.sql.xzand.sql.zstthat are found
in/docker-entrypoint-initdb.d
Let’s create ./etc/db/mariadb/01-init.sql file that will create database:
Then you can add 02-schema.sql file with database schema and 03-data.sql file with init data. You can commit those files to git and share them with all coworkers.