source -> database & config templating

This commit is contained in:
Janic Voser 2022-10-18 00:14:35 +02:00
parent 0c1cc86e3e
commit 414473c8c8
2 changed files with 33 additions and 0 deletions

0
src/db/init.sql Normal file
View File

View File

@ -0,0 +1,33 @@
# Do not adjust this file
version: '3.1'
services:
{% if db.enabled == true %}
ngx_mgmt_db:
image: mariadb:latest
restart: always
environment:
{% if db.root_pw is defined %}
MARIADB_ROOT_PASSWORD: {{ db.root_pw }}
{% endif %}
MARIADB_USER: {{ TMPL_DB_USER }}
MARIADB_PASSWORD: {{ TMPL_DB_USER_PW }}
MARIADB_DATABASE: {{ TMPL_DB_DB }}
volumes:
{% if db.data_path_mysql is defined %}
- {{ data_path_mysql }}:/var/lib/mysql
{% else %}
- ./src/db/cache/mysql_data:/var/lib/mysql
{% endif %}
{% if db.data_path_mysql_backup is defined %}
- {{ data_path_mysql_backup }}:/var/lib/mysql
{% else %}
- ./src/db/cache/mysql_backup:/var/lib/mysql
{% endif %}
ports:
{% if db.port is defined %}
- {{ port }}:3306
{% else %}
- 3306:3306
{% endif %}
{% endif %}