#!/bin/sh set -ev # Volumes MARIADB_CONF="${VOLUMES_DIR}/mifosx/mariadb_conf" MARIADB_DATA="${VOLUMES_DIR}/mifosx/mariadb_data" MIFOSX_CONF="${VOLUMES_DIR}/mifosx/mifosx_conf" # Create MariaDB instance install -o 100000 -g 100000 -m 755 -d ${MARIADB_CONF} install -o 103306 -g 103306 -m 750 -d ${MARIADB_DATA} install -o 100000 -g 100000 -m 644 mariadb_conf/my.cnf ${MARIADB_CONF}/my.cnf spoc-container exec -u 0 -g 0 mifosx-mariadb -- mysql_install_db --user=mysql --datadir=/var/lib/mysql --auth-root-authentication-method=socket --skip-test-db # Create databases export MIFOSX_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') spoc-container start mifosx-mariadb envsubst