levlaz / daggerverse

Personal Collection of Dagger Modules
MIT License
5 stars 3 forks source link

feature: add ability to mount db contents in mariadb module #9

Open levlaz opened 3 months ago

levlaz commented 3 months ago

The mariadb container offers this ability

Initializing the database contents

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.xz and .sql.zst that are found in /docker-entrypoint-initdb.d. Files will be executed in alphabetical order. .sh files without file execute permission are sourced rather than executed. You can easily populate your mariadb services by mounting a SQL dump into that directory and provide custom images with contributed data. SQL files will be imported by default to the database specified by the MARIADB_DATABASE variable.

https://hub.docker.com/_/mariadb

We should support this in the mariadb module by allowing an extra argument point to the contents directory and them mounting it at /docker-entrypoint-initdb.d