diff --git a/config-files/docker-compose-mariadb.yaml b/config-files/docker-compose-mariadb.yaml new file mode 100644 index 0000000..edfa17a --- /dev/null +++ b/config-files/docker-compose-mariadb.yaml @@ -0,0 +1,15 @@ +version: "3.8" + +services: + db: + container_name: ${HOST_NAME}_db + image: mariadb:${MARIADB_VERSION:-lts} + command: --innodb_strict_mode=off --innodb_flush_log_at_trx_commit=2 --transaction-isolation=READ-COMMITTED --sql_mode= + environment: + - "MYSQL_DATABASE=${MYSQL_DATABASE:-db}" + - "MYSQL_USER=${MYSQL_USER:-db}" + - "MYSQL_PASSWORD=${MYSQL_PASSWORD:-db}" + - "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}" + - "TZ=${TZ:-Europe/Moscow}" + volumes: + - "${PWD}/.docker/volume/mariadb/:/var/lib/mysql/:delegated" diff --git a/project/env.go b/project/env.go index 9c78c64..11ea703 100644 --- a/project/env.go +++ b/project/env.go @@ -111,6 +111,7 @@ func setComposeFiles() { images := map[string]string{ "mysql": templateDir + "/docker-compose-mysql.yaml", + "mariadb": templateDir + "/docker-compose-mariadb.yaml", "pgsql": templateDir + "/docker-compose-pgsql.yaml", "fpm": templateDir + "/docker-compose-fpm.yaml", "apache": templateDir + "/docker-compose-apache.yaml", @@ -131,6 +132,9 @@ func setComposeFiles() { if Env.GetFloat64("MYSQL_VERSION") > 0 { files = append(files, images["mysql"]) } + if Env.GetFloat64("MARIADB_VERSION") > 0 { + files = append(files, images["mariadb"]) + } if Env.GetFloat64("POSTGRES_VERSION") > 0 { files = append(files, images["pgsql"]) }