From 5ef782d00ff59aecf807f1e76895174967d8b847 Mon Sep 17 00:00:00 2001 From: Tom Harper Date: Fri, 14 Jun 2024 11:58:14 +0100 Subject: [PATCH] Copy nginx.conf and php.ini if present (#24) --- resources/scripts/nginx/entrypoint.sh | 9 ++++++++- resources/scripts/php/entrypoint.sh | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/resources/scripts/nginx/entrypoint.sh b/resources/scripts/nginx/entrypoint.sh index a9ce616..3217a19 100755 --- a/resources/scripts/nginx/entrypoint.sh +++ b/resources/scripts/nginx/entrypoint.sh @@ -19,6 +19,13 @@ if [[ ! -z "${QA_INSTANCE}" ]]; then fi fi +# Detect if we have our own custom Nginx.conf to use instead +if [ -f '/var/www/.volker/nginx/nginx.conf' ]; then + echo 'Found custom Nginx configuration to apply' + cp /var/www/.volker/nginx/nginx.conf /etc/nginx/nginx.conf + echo 'Done' +fi + # Generate the Nginx configuration using the configuration script echo 'Generating Nginx Configuration'; sh /docker-scripts/generate-config.sh > /root/app.conf @@ -28,4 +35,4 @@ echo 'Done'; echo 'Signalling Reload to Nginx..' nginx -s reload -echo 'Finished' \ No newline at end of file +echo 'Finished' diff --git a/resources/scripts/php/entrypoint.sh b/resources/scripts/php/entrypoint.sh index 119d755..53b4cbc 100755 --- a/resources/scripts/php/entrypoint.sh +++ b/resources/scripts/php/entrypoint.sh @@ -47,11 +47,20 @@ fi if [ -f '/var/www/.volker/php/custom-root-script.sh' ]; then echo 'Found custom-root-script.sh to run' sudo -E /var/www/.volker/php/custom-root-script.sh + echo 'Done' fi if [ -f '/var/www/.volker/php/custom-www-script.sh' ]; then echo 'Found custom-www-script.sh to run' /var/www/.volker/php/custom-www-script.sh + echo 'Done' +fi + +# Detect if we have our own custom php.ini to apply +if [ -f '/var/www/.volker/php/php.ini' ]; then + echo 'Found custom php.ini to apply' + sudo cp /var/www/.volker/php/php.ini /usr/local/etc/php/conf.d/zzz-php.ini + echo 'Done' fi echo "Running command exec $*"