Skip to content

Commit

Permalink
Merge pull request #115 from local-deploy/DL-T-96
Browse files Browse the repository at this point in the history
feat(app): add MariaDB container
  • Loading branch information
varrcan authored Jan 24, 2024
2 parents 7e2c24c + e0677a1 commit c97bd97
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions config-files/docker-compose-mariadb.yaml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 4 additions & 0 deletions project/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"])
}
Expand Down

0 comments on commit c97bd97

Please sign in to comment.