From b82204fbb9feb80d069c6473c753e7b0f9012576 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Fri, 11 Jun 2021 17:36:15 -0400 Subject: [PATCH 1/2] Cleaned up the `php-dev-craft` & `php-prod-craft` Dockerfile file permissions --- .../php-7.4-alpine/mariadb/Dockerfile | 13 ++++------ .../php-7.4-alpine/postgres/Dockerfile | 13 ++++------ .../php-8.0-alpine/mariadb/Dockerfile | 13 ++++------ .../php-8.0-alpine/postgres/Dockerfile | 13 ++++------ .../php-7.4-alpine/mariadb/Dockerfile | 26 +++++-------------- .../php-7.4-alpine/postgres/Dockerfile | 26 +++++-------------- .../php-8.0-alpine/mariadb/Dockerfile | 26 +++++-------------- .../php-8.0-alpine/postgres/Dockerfile | 26 +++++-------------- 8 files changed, 48 insertions(+), 108 deletions(-) diff --git a/php-dev-craft/php-7.4-alpine/mariadb/Dockerfile b/php-dev-craft/php-7.4-alpine/mariadb/Dockerfile index 2587eca..b5e78af 100755 --- a/php-dev-craft/php-7.4-alpine/mariadb/Dockerfile +++ b/php-dev-craft/php-7.4-alpine/mariadb/Dockerfile @@ -45,14 +45,11 @@ RUN set -eux; \ WORKDIR /var/www/project -# Create the storage directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/storage && \ - mkdir -p /var/www/project/cms/storage/runtime && \ - chown -R www-data:www-data /var/www/project/cms/storage - -# Create the cpresources directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/web/cpresources && \ - chown -R www-data:www-data /var/www/project/cms/web/cpresources +RUN mkdir -p /var/www/project/cms/storage \ + && \ + mkdir -p /var/www/project/cms/web/cpresources \ + && \ + chown -R www-data:www-data /var/www/project WORKDIR /var/www/project/cms diff --git a/php-dev-craft/php-7.4-alpine/postgres/Dockerfile b/php-dev-craft/php-7.4-alpine/postgres/Dockerfile index 3edc846..bb8968d 100755 --- a/php-dev-craft/php-7.4-alpine/postgres/Dockerfile +++ b/php-dev-craft/php-7.4-alpine/postgres/Dockerfile @@ -47,14 +47,11 @@ RUN set -eux; \ WORKDIR /var/www/project -# Create the storage directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/storage && \ - mkdir -p /var/www/project/cms/storage/runtime && \ - chown -R www-data:www-data /var/www/project/cms/storage - -# Create the cpresources directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/web/cpresources && \ - chown -R www-data:www-data /var/www/project/cms/web/cpresources +RUN mkdir -p /var/www/project/cms/storage \ + && \ + mkdir -p /var/www/project/cms/web/cpresources \ + && \ + chown -R www-data:www-data /var/www/project WORKDIR /var/www/project/cms diff --git a/php-dev-craft/php-8.0-alpine/mariadb/Dockerfile b/php-dev-craft/php-8.0-alpine/mariadb/Dockerfile index 6d390c7..d18ffc5 100755 --- a/php-dev-craft/php-8.0-alpine/mariadb/Dockerfile +++ b/php-dev-craft/php-8.0-alpine/mariadb/Dockerfile @@ -45,14 +45,11 @@ RUN set -eux; \ WORKDIR /var/www/project -# Create the storage directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/storage && \ - mkdir -p /var/www/project/cms/storage/runtime && \ - chown -R www-data:www-data /var/www/project/cms/storage - -# Create the cpresources directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/web/cpresources && \ - chown -R www-data:www-data /var/www/project/cms/web/cpresources +RUN mkdir -p /var/www/project/cms/storage \ + && \ + mkdir -p /var/www/project/cms/web/cpresources \ + && \ + chown -R www-data:www-data /var/www/project WORKDIR /var/www/project/cms diff --git a/php-dev-craft/php-8.0-alpine/postgres/Dockerfile b/php-dev-craft/php-8.0-alpine/postgres/Dockerfile index 5cfe1b0..3a75be8 100755 --- a/php-dev-craft/php-8.0-alpine/postgres/Dockerfile +++ b/php-dev-craft/php-8.0-alpine/postgres/Dockerfile @@ -47,14 +47,11 @@ RUN set -eux; \ WORKDIR /var/www/project -# Create the storage directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/storage && \ - mkdir -p /var/www/project/cms/storage/runtime && \ - chown -R www-data:www-data /var/www/project/cms/storage - -# Create the cpresources directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/web/cpresources && \ - chown -R www-data:www-data /var/www/project/cms/web/cpresources +RUN mkdir -p /var/www/project/cms/storage \ + && \ + mkdir -p /var/www/project/cms/web/cpresources \ + && \ + chown -R www-data:www-data /var/www/project WORKDIR /var/www/project/cms diff --git a/php-prod-craft/php-7.4-alpine/mariadb/Dockerfile b/php-prod-craft/php-7.4-alpine/mariadb/Dockerfile index beaa5df..4ae0bc1 100755 --- a/php-prod-craft/php-7.4-alpine/mariadb/Dockerfile +++ b/php-prod-craft/php-7.4-alpine/mariadb/Dockerfile @@ -46,19 +46,13 @@ RUN set -eux; \ WORKDIR /var/www/project COPY ./run_queue.sh . -RUN chmod a+x run_queue.sh - -# Create the storage directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/storage && \ - mkdir -p /var/www/project/cms/storage/runtime && \ - chown -R www-data:www-data /var/www/project/cms/storage - -# Create the cpresources directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/web/cpresources && \ - chown -R www-data:www-data /var/www/project/cms/web/cpresources - -# Permissions -RUN chown -R www-data:www-data /var/www/project/cms/web +RUN chmod a+x run_queue.sh \ + && \ + mkdir -p /var/www/project/cms/storage \ + && \ + mkdir -p /var/www/project/cms/web/cpresources \ + && \ + chown -R www-data:www-data /var/www/project WORKDIR /var/www/project/cms @@ -75,12 +69,6 @@ USER www-data # but saves far more time in not having to deal with out of sync versions # when working with teams or multiple environments CMD composer install --verbose --no-progress --no-scripts --optimize-autoloader --no-interaction \ - && \ - chown -R www-data:www-data /var/www/project/cms/vendor \ - && \ - chown -R www-data:www-data /var/www/project/cms/storage \ - && \ - chown -R www-data:www-data /var/www/project/cms/web \ && \ composer craft-update \ && \ diff --git a/php-prod-craft/php-7.4-alpine/postgres/Dockerfile b/php-prod-craft/php-7.4-alpine/postgres/Dockerfile index 6a9c485..55e6cdb 100755 --- a/php-prod-craft/php-7.4-alpine/postgres/Dockerfile +++ b/php-prod-craft/php-7.4-alpine/postgres/Dockerfile @@ -48,19 +48,13 @@ RUN set -eux; \ WORKDIR /var/www/project COPY ./run_queue.sh . -RUN chmod a+x run_queue.sh - -# Create the storage directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/storage && \ - mkdir -p /var/www/project/cms/storage/runtime && \ - chown -R www-data:www-data /var/www/project/cms/storage - -# Create the cpresources directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/web/cpresources && \ - chown -R www-data:www-data /var/www/project/cms/web/cpresources - -# Permissions -RUN chown -R www-data:www-data /var/www/project/cms/web +RUN chmod a+x run_queue.sh \ + && \ + mkdir -p /var/www/project/cms/storage \ + && \ + mkdir -p /var/www/project/cms/web/cpresources \ + && \ + chown -R www-data:www-data /var/www/project WORKDIR /var/www/project/cms @@ -77,12 +71,6 @@ USER www-data # but saves far more time in not having to deal with out of sync versions # when working with teams or multiple environments CMD composer install --verbose --no-progress --no-scripts --optimize-autoloader --no-interaction \ - && \ - chown -R www-data:www-data /var/www/project/cms/vendor \ - && \ - chown -R www-data:www-data /var/www/project/cms/storage \ - && \ - chown -R www-data:www-data /var/www/project/cms/web \ && \ composer craft-update \ && \ diff --git a/php-prod-craft/php-8.0-alpine/mariadb/Dockerfile b/php-prod-craft/php-8.0-alpine/mariadb/Dockerfile index 4d2dfd4..fb71e39 100755 --- a/php-prod-craft/php-8.0-alpine/mariadb/Dockerfile +++ b/php-prod-craft/php-8.0-alpine/mariadb/Dockerfile @@ -46,19 +46,13 @@ RUN set -eux; \ WORKDIR /var/www/project COPY ./run_queue.sh . -RUN chmod a+x run_queue.sh - -# Create the storage directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/storage && \ - mkdir -p /var/www/project/cms/storage/runtime && \ - chown -R www-data:www-data /var/www/project/cms/storage - -# Create the cpresources directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/web/cpresources && \ - chown -R www-data:www-data /var/www/project/cms/web/cpresources - -# Permissions -RUN chown -R www-data:www-data /var/www/project/cms/web +RUN chmod a+x run_queue.sh \ + && \ + mkdir -p /var/www/project/cms/storage \ + && \ + mkdir -p /var/www/project/cms/web/cpresources \ + && \ + chown -R www-data:www-data /var/www/project WORKDIR /var/www/project/cms @@ -75,12 +69,6 @@ USER www-data # but saves far more time in not having to deal with out of sync versions # when working with teams or multiple environments CMD composer install --verbose --no-progress --no-scripts --optimize-autoloader --no-interaction \ - && \ - chown -R www-data:www-data /var/www/project/cms/vendor \ - && \ - chown -R www-data:www-data /var/www/project/cms/storage \ - && \ - chown -R www-data:www-data /var/www/project/cms/web \ && \ composer craft-update \ && \ diff --git a/php-prod-craft/php-8.0-alpine/postgres/Dockerfile b/php-prod-craft/php-8.0-alpine/postgres/Dockerfile index 0f75726..79ef75f 100755 --- a/php-prod-craft/php-8.0-alpine/postgres/Dockerfile +++ b/php-prod-craft/php-8.0-alpine/postgres/Dockerfile @@ -48,19 +48,13 @@ RUN set -eux; \ WORKDIR /var/www/project COPY ./run_queue.sh . -RUN chmod a+x run_queue.sh - -# Create the storage directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/storage && \ - mkdir -p /var/www/project/cms/storage/runtime && \ - chown -R www-data:www-data /var/www/project/cms/storage - -# Create the cpresources directory and make it writeable by PHP -RUN mkdir -p /var/www/project/cms/web/cpresources && \ - chown -R www-data:www-data /var/www/project/cms/web/cpresources - -# Permissions -RUN chown -R www-data:www-data /var/www/project/cms/web +RUN chmod a+x run_queue.sh \ + && \ + mkdir -p /var/www/project/cms/storage \ + && \ + mkdir -p /var/www/project/cms/web/cpresources \ + && \ + chown -R www-data:www-data /var/www/project WORKDIR /var/www/project/cms @@ -77,12 +71,6 @@ USER www-data # but saves far more time in not having to deal with out of sync versions # when working with teams or multiple environments CMD composer install --verbose --no-progress --no-scripts --optimize-autoloader --no-interaction \ - && \ - chown -R www-data:www-data /var/www/project/cms/vendor \ - && \ - chown -R www-data:www-data /var/www/project/cms/storage \ - && \ - chown -R www-data:www-data /var/www/project/cms/web \ && \ composer craft-update \ && \ From f37e061577085467e32f192836620935e67e7c4b Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Fri, 11 Jun 2021 17:36:25 -0400 Subject: [PATCH 2/2] Version 1.2.15 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca5b7f5..9fb4f2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # nystudio107/docker-images Change Log +## 1.2.15 - 2021.06.11 +### Changed +* Cleaned up the `php-dev-craft` & `php-prod-craft` Dockerfile file permissions + ## 1.2.14 - 2021.06.11 ### Added * Added GitHub actions for automated Docker image building & pushing