From a90c60009ca69f5545a0c0754544c303ae8bad69 Mon Sep 17 00:00:00 2001 From: Jack McNicol Date: Fri, 22 Jul 2016 02:43:37 +0930 Subject: [PATCH] set clear_env => no enables $_ENV[] can be used without hack sed replace --- Dockerfile | 3 ++- scripts/start.sh | 13 ------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7de2634..e3b09b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.4 MAINTAINER ngineered -ENV php_conf /etc/php5/php.ini +ENV php_conf /etc/php5/php.ini ENV fpm_conf /etc/php5/php-fpm.conf ENV composer_hash e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae @@ -77,6 +77,7 @@ sed -i -e "s/;listen.mode = 0660/listen.mode = 0666/g" ${fpm_conf} && \ sed -i -e "s/;listen.owner = nobody/listen.owner = nginx/g" ${fpm_conf} && \ sed -i -e "s/;listen.group = nobody/listen.group = nginx/g" ${fpm_conf} && \ sed -i -e "s/listen = 127.0.0.1:9000/listen = \/var\/run\/php-fpm.sock/g" ${fpm_conf} &&\ +sed -i -e "s/^;clear_env = no$/clear_env = no/" ${fpm_conf} &&\ ln -s /etc/php5/php.ini /etc/php5/conf.d/php.ini && \ find /etc/php5/conf.d/ -name "*.ini" -exec sed -i -re 's/^(\s*)#(.*)/\1;\2/g' {} \; diff --git a/scripts/start.sh b/scripts/start.sh index 4d5c846..8e653a4 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -71,19 +71,6 @@ if [ ! -z "$PHP_UPLOAD_MAX_FILESIZE" ]; then sed -i "s/upload_max_filesize = 100M/upload_max_filesize= ${PHP_UPLOAD_MAX_FILESIZE}M/g" /etc/php5/conf.d/php.ini fi -# Very dirty hack to replace variables in code with ENVIRONMENT values -if [[ "$TEMPLATE_NGINX_HTML" == "1" ]] ; then - for i in $(env) - do - variable=$(echo "$i" | cut -d'=' -f1) - value=$(echo "$i" | cut -d'=' -f2) - if [[ "$variable" != '%s' ]] ; then - replace='\$\$_'${variable}'_\$\$' - find /var/www/html -type f -exec sed -i -e 's/'${replace}'/'${value}'/g' {} \; - fi - done -fi - # Always chown webroot for better mounting chown -Rf nginx.nginx $webroot