From 2a154a6cf5b7bf17f8a992bb9507bba37b0543be Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 19 Aug 2018 01:38:49 +0200 Subject: Update docker setup Signed-off-by: Florian Pritz --- docker/filebin_starter.sh | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) (limited to 'docker/filebin_starter.sh') diff --git a/docker/filebin_starter.sh b/docker/filebin_starter.sh index 4fa50d583..7f0b70d85 100755 --- a/docker/filebin_starter.sh +++ b/docker/filebin_starter.sh @@ -1,15 +1,44 @@ #!/bin/bash +#set -euo pipefail + function set_config() { FB_ENCRYPTION_KEY=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32` - sed -i "s/\$config\['encryption_key'\] = ''/\$config['encryption_key'] = '${FB_ENCRYPTION_KEY}'/" ${FILEBIN_DIR}/application/config/config-local.php +cat <${FILEBIN_DIR}/application/config/config-local.php +${FILEBIN_DIR}/application/config/database.php + 'mysql:host=${FB_DB_HOSTNAME};dbname=${FB_DB_DATABASE}', + 'hostname' => '', + 'port' => 3306, + 'username' => '${FB_DB_USERNAME}', + 'password' => '${FB_DB_PASSWORD}', + 'database' => '', + 'dbdriver' => 'pdo', + 'dbprefix' => '', + 'pconnect' => FALSE, + 'db_debug' => TRUE, + 'char_set' => 'utf8mb4', // if you use postgres, set this to utf8 + 'dbcollat' => 'utf8mb4_bin', // if you use postgres, set this to utf8_bin + 'swap_pre' => '', + 'encrypt' => FALSE, + 'compress' => FALSE, + 'stricton' => TRUE, + 'failover' => array(), + 'save_queries' => TRUE +); +EOF } # wait for DB to be ready @@ -21,7 +50,6 @@ done if [[ ! -e $FILEBIN_DIR/application/config/config-local.php ]]; then echo "no config found, new config will be generated" - cp $FILEBIN_DIR/application/config/example/config-local.php ${FILEBIN_DIR}/application/config/config-local.php set_config set_database_config -- cgit v1.2.3-24-g4f1b