From 48b556e7dc918fc2f95b6aa5657eb78f718f6c7a Mon Sep 17 00:00:00 2001 From: matbgn Date: Wed, 18 May 2022 22:04:02 +0200 Subject: [PATCH] Functional without volume --- Dockerfile | 42 ++++++++++++++++++++++---------------- docker-utils/adjust-rights | 7 ++++--- docker-utils/init-server | 19 +++++++++-------- system/system.php | 2 +- 4 files changed, 39 insertions(+), 31 deletions(-) diff --git a/Dockerfile b/Dockerfile index ef1bcf4..bb8ad86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,34 +12,40 @@ RUN docker-php-ext-install gd COPY docker-utils /usr/local/bin -WORKDIR /src +#WORKDIR /src +# +#COPY system ./system +#COPY .htaccess \ +# composer* \ +# index.php \ +# /src/ +#COPY cache ./cache +#COPY data ./data +#COPY media ./media +#COPY settings ./settings +#COPY themes ./themes -COPY system ./system -COPY .htaccess \ - composer* \ - index.php \ - /src/ -COPY cache ./cache -COPY data ./data -COPY media ./media -COPY settings ./settings -COPY themes ./themes +#WORKDIR /tmp +# +#COPY content ./content + +WORKDIR /var/www/html +COPY . /src/ +COPY . . RUN chmod +x /usr/local/bin/install-composer && \ /usr/local/bin/install-composer && \ ./composer.phar update && \ - chmod +x /usr/local/bin/init-server && \ - chmod +x /usr/local/bin/adjust-rights + chmod +x /usr/local/bin/init-server +# chmod +x /usr/local/bin/adjust-rights && \ +# /usr/local/bin/adjust-rights -WORKDIR /tmp - -COPY content ./content # Create a non-root user to own the files and run our server -WORKDIR /var/www/html +#WORKDIR /var/www/html # Expose single volume of data to simplify maintenance -VOLUME /var/www/html +#VOLUME /var/www/html/content #RUN cp -R /src/* /var/www/html/ #RUN cp -R /tmp/* /var/www/html/ diff --git a/docker-utils/adjust-rights b/docker-utils/adjust-rights index a05cf08..5993c61 100644 --- a/docker-utils/adjust-rights +++ b/docker-utils/adjust-rights @@ -1,8 +1,9 @@ #!/bin/sh -chown -R www-data:www-data /var/www/html -find /var/www/html -type d -exec chmod 570 {} \; -find /var/www/html -type f -exec chmod 460 {} \; +#chown -R www-data:www-data /var/www/html +#find /var/www/html -type d -exec chmod 570 {} \; +#find /var/www/html -type f -exec chmod 460 {} \; +echo TestMBO1 chown -R www-data:www-data /var/www/html/cache find /var/www/html/cache -type d -exec chmod 770 {} \; find /var/www/html/cache -type f -exec chmod 660 {} \; diff --git a/docker-utils/init-server b/docker-utils/init-server index 2933aad..91245b0 100644 --- a/docker-utils/init-server +++ b/docker-utils/init-server @@ -1,16 +1,17 @@ #!/bin/sh -find /var/www/html -type d -empty -exec cp -R /tmp/* /var/www/html/ \; +#usermod -u $PUID www-data +#groupmod -g $PGID www-data +#find /var/www/html -type d -empty -exec cp -R /tmp/* /var/www/html/ \; +# +#cp -R /src/* /var/www/html/ +#cp -R /tmp/* /var/www/html/ -cp -R /src/* /var/www/html/ -cp -R /tmp/* /var/www/html/ +#/usr/local/bin/install-composer && \ +#./composer.phar update -/usr/local/bin/install-composer && \ -./composer.phar update -usermod -u $PUID www-data -groupmod -g $PGID www-data - -/usr/local/bin/adjust-rights +chown www-data:www-data /var/www/html/ +#/usr/local/bin/adjust-rights apache2-foreground \ No newline at end of file diff --git a/system/system.php b/system/system.php index e02c00d..cd33c34 100644 --- a/system/system.php +++ b/system/system.php @@ -29,7 +29,7 @@ $settings = Typemill\Settings::loadSettings(); /**************************** * HANDLE DISPLAY ERRORS * ****************************/ -$settings['settings']['displayErrorDetails'] = true; +//$settings['settings']['displayErrorDetails'] = true; if(isset($settings['settings']['displayErrorDetails']) && $settings['settings']['displayErrorDetails']) { ini_set('display_errors', 1);