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 --- Dockerfile | 4 ++-- docker/filebin_starter.sh | 40 ++++++++++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b18a4e81..9b6c8f705 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:edge MAINTAINER Sebastian Rakel -RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing bash php5 py-pygments py2-pip imagemagick php5-gd nodejs composer php5-pdo_mysql php5-exif +RUN apk add --no-cache -X https://dl-cdn.alpinelinux.org/alpine/edge/testing bash php7 py-pygments py2-pip imagemagick php7-gd nodejs composer php7-pdo_mysql php7-exif php7-ctype php7-session git ENV FILEBIN_HOME_DIR /var/lib/filebin ENV FILEBIN_DIR $FILEBIN_HOME_DIR/filebin @@ -9,7 +9,7 @@ ENV FILEBIN_DIR $FILEBIN_HOME_DIR/filebin ADD . $FILEBIN_DIR RUN adduser -S -h $FILEBIN_HOME_DIR filebin -RUN chown filebin: -R $FILEBIN_HOME_DIR +RUN chown filebin: -R $FILEBIN_HOME_DIR RUN pip install ansi2html 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