From 7850817630ff43b3d6a6b58f435c2f37089fb133 Mon Sep 17 00:00:00 2001 From: Tyler Craft Date: Fri, 12 Mar 2021 10:19:36 -0500 Subject: [PATCH 01/20] add Access-Control-Allow-Origin * to magento2.conf to fix CORS issue with loading fonts hosted in Magento in Mailhog --- .../context/etc/nginx/available.d/magento2.conf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/images/nginx/context/etc/nginx/available.d/magento2.conf b/images/nginx/context/etc/nginx/available.d/magento2.conf index 156f86fe..2c5e41cc 100644 --- a/images/nginx/context/etc/nginx/available.d/magento2.conf +++ b/images/nginx/context/etc/nginx/available.d/magento2.conf @@ -67,7 +67,7 @@ location /static/ { rewrite ^/static/(version[^/]+/)?(.*)$ /static/$2 last; } - location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|json)$ { + location ~* \.(ico|jpg|jpeg|png|gif|js|css|swf|json)$ { add_header Cache-Control "public"; add_header X-Frame-Options "SAMEORIGIN"; expires +1y; @@ -76,6 +76,17 @@ location /static/ { rewrite ^/static/?(.*)$ /static.php?resource=$1 last; } } + + location ~* \.(eot|ttf|otf|svg|woff|woff2)$ { + add_header Access-Control-Allow-Origin *; + add_header Cache-Control "public"; + add_header X-Frame-Options "SAMEORIGIN"; + expires +1y; + if (!-f $request_filename) { + rewrite ^/static/?(.*)$ /static.php?resource=$1 last; + } + } + location ~* \.(zip|gz|gzip|bz2|csv|xml)$ { add_header Cache-Control "no-store"; add_header X-Frame-Options "SAMEORIGIN"; From 54e5b0df028306e1244ebec46ac4afdd199da405 Mon Sep 17 00:00:00 2001 From: Dmitriy Klyuzov Date: Mon, 5 Apr 2021 18:41:27 -0400 Subject: [PATCH 02/20] Laravel: increase read timeout to prevent 504s when debugging --- images/nginx/context/etc/nginx/available.d/application.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/nginx/context/etc/nginx/available.d/application.conf b/images/nginx/context/etc/nginx/available.d/application.conf index 37bc7c7f..a12a3ba1 100644 --- a/images/nginx/context/etc/nginx/available.d/application.conf +++ b/images/nginx/context/etc/nginx/available.d/application.conf @@ -13,7 +13,7 @@ location ~ \.php$ { fastcgi_buffers 1024 4k; fastcgi_buffer_size 32k; fastcgi_busy_buffers_size 256k; - fastcgi_read_timeout 60s; + fastcgi_read_timeout 3200s; include fastcgi_params; From f7be975a69966929d465a5615618e87c224d830f Mon Sep 17 00:00:00 2001 From: David Alger Date: Tue, 6 Apr 2021 12:10:14 -0500 Subject: [PATCH 03/20] Update images/nginx/context/etc/nginx/available.d/application.conf Co-authored-by: Ihor Sviziev --- images/nginx/context/etc/nginx/available.d/application.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/nginx/context/etc/nginx/available.d/application.conf b/images/nginx/context/etc/nginx/available.d/application.conf index a12a3ba1..4211bf8a 100644 --- a/images/nginx/context/etc/nginx/available.d/application.conf +++ b/images/nginx/context/etc/nginx/available.d/application.conf @@ -13,7 +13,7 @@ location ~ \.php$ { fastcgi_buffers 1024 4k; fastcgi_buffer_size 32k; fastcgi_busy_buffers_size 256k; - fastcgi_read_timeout 3200s; + fastcgi_read_timeout 600s; include fastcgi_params; From ddc0f00f3c6c019ebf24a4c8981940eb845a1a3e Mon Sep 17 00:00:00 2001 From: David Alger Date: Mon, 12 Apr 2021 13:14:10 -0500 Subject: [PATCH 04/20] Remove use of IUS repo for MariaDB as 10.3 is available in EL 8 by default --- images/php-fpm/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/php-fpm/Dockerfile b/images/php-fpm/Dockerfile index eab57494..4204d2be 100644 --- a/images/php-fpm/Dockerfile +++ b/images/php-fpm/Dockerfile @@ -11,7 +11,7 @@ ENV MAILHOG_PORT 1025 RUN yum install -y which pv sudo bind-utils python3-pip bash-completion rsync socat oathtool \ wget ack make gcc gcc-c++ automake autoconf crontabs \ - && yum install -y --enablerepo=ius mariadb102 \ + && yum install -y mariadb \ && yum clean all \ && rm -rf /var/cache/yum From 9bc4e42663c5f3e78e9d883530de2fd1657a4e9d Mon Sep 17 00:00:00 2001 From: David Alger Date: Mon, 12 Apr 2021 13:18:56 -0500 Subject: [PATCH 05/20] Remove install of pygpgme from blackfire images --- images/php-fpm/blackfire/Dockerfile | 4 ++-- images/php-fpm/magento1/blackfire/Dockerfile | 4 ++-- images/php-fpm/magento2/blackfire/Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/images/php-fpm/blackfire/Dockerfile b/images/php-fpm/blackfire/Dockerfile index 6fb18a63..c7756eb8 100644 --- a/images/php-fpm/blackfire/Dockerfile +++ b/images/php-fpm/blackfire/Dockerfile @@ -2,8 +2,8 @@ ARG PHP_VERSION= FROM docker.io/wardenenv/php-fpm:${PHP_VERSION} USER root -RUN yum install -y pygpgme \ - && curl -o - "http://packages.blackfire.io/fedora/blackfire.repo" | sudo tee /etc/yum.repos.d/blackfire.repo \ +RUN curl -o - "http://packages.blackfire.io/fedora/blackfire.repo" \ + | sudo tee /etc/yum.repos.d/blackfire.repo \ && yum install -y blackfire-php \ && yum clean all \ && rm -rf /var/cache/yum diff --git a/images/php-fpm/magento1/blackfire/Dockerfile b/images/php-fpm/magento1/blackfire/Dockerfile index 028a4e58..27fccce7 100644 --- a/images/php-fpm/magento1/blackfire/Dockerfile +++ b/images/php-fpm/magento1/blackfire/Dockerfile @@ -2,8 +2,8 @@ ARG PHP_VERSION FROM docker.io/wardenenv/php-fpm:${PHP_VERSION}-magento1 USER root -RUN yum install -y pygpgme \ - && curl -o - "http://packages.blackfire.io/fedora/blackfire.repo" | sudo tee /etc/yum.repos.d/blackfire.repo \ +RUN curl -o - "http://packages.blackfire.io/fedora/blackfire.repo" \ + | sudo tee /etc/yum.repos.d/blackfire.repo \ && yum install -y blackfire-php \ && yum clean all \ && rm -rf /var/cache/yum diff --git a/images/php-fpm/magento2/blackfire/Dockerfile b/images/php-fpm/magento2/blackfire/Dockerfile index 17ba27d6..30fe4301 100644 --- a/images/php-fpm/magento2/blackfire/Dockerfile +++ b/images/php-fpm/magento2/blackfire/Dockerfile @@ -2,8 +2,8 @@ ARG PHP_VERSION FROM docker.io/wardenenv/php-fpm:${PHP_VERSION}-magento2 USER root -RUN yum install -y pygpgme \ - && curl -o - "http://packages.blackfire.io/fedora/blackfire.repo" | sudo tee /etc/yum.repos.d/blackfire.repo \ +RUN curl -o - "http://packages.blackfire.io/fedora/blackfire.repo" \ + | sudo tee /etc/yum.repos.d/blackfire.repo \ && yum install -y blackfire-php \ && yum clean all \ && rm -rf /var/cache/yum From b7d14076358bb5dc97d79c2cecb52900b968e0ff Mon Sep 17 00:00:00 2001 From: David Alger Date: Mon, 12 Apr 2021 13:37:23 -0500 Subject: [PATCH 06/20] Replace yum usage with dnf --- images/php-fpm/Dockerfile | 8 ++++---- images/php-fpm/blackfire/Dockerfile | 6 +++--- images/php-fpm/debug/Dockerfile | 6 +++--- images/php-fpm/magento1/blackfire/Dockerfile | 6 +++--- images/php-fpm/magento1/debug/Dockerfile | 6 +++--- images/php-fpm/magento1/xdebug3/Dockerfile | 6 +++--- images/php-fpm/magento2/blackfire/Dockerfile | 6 +++--- images/php-fpm/magento2/debug/Dockerfile | 6 +++--- images/php-fpm/magento2/xdebug3/Dockerfile | 6 +++--- images/php-fpm/xdebug3/Dockerfile | 6 +++--- images/varnish/4.1/Dockerfile | 14 +++++++------- images/varnish/6.0/Dockerfile | 14 +++++++------- images/varnish/6.4/Dockerfile | 14 +++++++------- images/varnish/6.5/Dockerfile | 14 +++++++------- 14 files changed, 59 insertions(+), 59 deletions(-) diff --git a/images/php-fpm/Dockerfile b/images/php-fpm/Dockerfile index 4204d2be..72910a17 100644 --- a/images/php-fpm/Dockerfile +++ b/images/php-fpm/Dockerfile @@ -9,11 +9,11 @@ ENV COMPOSER_HOME= ENV MAILHOG_HOST mailhog ENV MAILHOG_PORT 1025 -RUN yum install -y which pv sudo bind-utils python3-pip bash-completion rsync socat oathtool \ +RUN dnf install -y which pv sudo bind-utils python3-pip bash-completion rsync socat oathtool \ wget ack make gcc gcc-c++ automake autoconf crontabs \ - && yum install -y mariadb \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y mariadb \ + && dnf clean all \ + && rm -rf /var/cache/dnf ENV NODE_VERSION 10 RUN npm install -g n \ diff --git a/images/php-fpm/blackfire/Dockerfile b/images/php-fpm/blackfire/Dockerfile index c7756eb8..20a499a4 100644 --- a/images/php-fpm/blackfire/Dockerfile +++ b/images/php-fpm/blackfire/Dockerfile @@ -4,9 +4,9 @@ USER root RUN curl -o - "http://packages.blackfire.io/fedora/blackfire.repo" \ | sudo tee /etc/yum.repos.d/blackfire.repo \ - && yum install -y blackfire-php \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y blackfire-php \ + && dnf clean all \ + && rm -rf /var/cache/dnf # Install the Blackfire Client to provide access to the CLI tool RUN mkdir -p /tmp/blackfire \ diff --git a/images/php-fpm/debug/Dockerfile b/images/php-fpm/debug/Dockerfile index be85f410..580c65d6 100644 --- a/images/php-fpm/debug/Dockerfile +++ b/images/php-fpm/debug/Dockerfile @@ -3,9 +3,9 @@ FROM docker.io/wardenenv/php-fpm:${PHP_VERSION} USER root RUN set -eux \ - && yum install -y php-pecl-xdebug \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y php-pecl-xdebug \ + && dnf clean all \ + && rm -rf /var/cache/dnf COPY debug/etc/*.ini /etc/ COPY debug/etc/php.d/*.ini /etc/php.d/ diff --git a/images/php-fpm/magento1/blackfire/Dockerfile b/images/php-fpm/magento1/blackfire/Dockerfile index 27fccce7..31a0d7ea 100644 --- a/images/php-fpm/magento1/blackfire/Dockerfile +++ b/images/php-fpm/magento1/blackfire/Dockerfile @@ -4,9 +4,9 @@ USER root RUN curl -o - "http://packages.blackfire.io/fedora/blackfire.repo" \ | sudo tee /etc/yum.repos.d/blackfire.repo \ - && yum install -y blackfire-php \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y blackfire-php \ + && dnf clean all \ + && rm -rf /var/cache/dnf COPY blackfire/etc/php.d/*.ini /etc/php.d/ diff --git a/images/php-fpm/magento1/debug/Dockerfile b/images/php-fpm/magento1/debug/Dockerfile index 1a8163a3..be0d1dd4 100644 --- a/images/php-fpm/magento1/debug/Dockerfile +++ b/images/php-fpm/magento1/debug/Dockerfile @@ -3,9 +3,9 @@ FROM docker.io/wardenenv/php-fpm:${PHP_VERSION}-magento1 USER root RUN set -eux \ - && yum install -y php-pecl-xdebug \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y php-pecl-xdebug \ + && dnf clean all \ + && rm -rf /var/cache/dnf COPY debug/etc/*.ini /etc/ COPY debug/etc/php.d/*.ini /etc/php.d/ diff --git a/images/php-fpm/magento1/xdebug3/Dockerfile b/images/php-fpm/magento1/xdebug3/Dockerfile index 707412c8..271092bc 100644 --- a/images/php-fpm/magento1/xdebug3/Dockerfile +++ b/images/php-fpm/magento1/xdebug3/Dockerfile @@ -3,9 +3,9 @@ FROM docker.io/wardenenv/php-fpm:${PHP_VERSION}-magento1 USER root RUN set -eux \ - && yum install -y php-pecl-xdebug3 \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y php-pecl-xdebug3 \ + && dnf clean all \ + && rm -rf /var/cache/dnf COPY xdebug3/etc/*.ini /etc/ COPY xdebug3/etc/php.d/*.ini /etc/php.d/ diff --git a/images/php-fpm/magento2/blackfire/Dockerfile b/images/php-fpm/magento2/blackfire/Dockerfile index 30fe4301..e2ee4918 100644 --- a/images/php-fpm/magento2/blackfire/Dockerfile +++ b/images/php-fpm/magento2/blackfire/Dockerfile @@ -4,9 +4,9 @@ USER root RUN curl -o - "http://packages.blackfire.io/fedora/blackfire.repo" \ | sudo tee /etc/yum.repos.d/blackfire.repo \ - && yum install -y blackfire-php \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y blackfire-php \ + && dnf clean all \ + && rm -rf /var/cache/dnf COPY blackfire/etc/php.d/*.ini /etc/php.d/ diff --git a/images/php-fpm/magento2/debug/Dockerfile b/images/php-fpm/magento2/debug/Dockerfile index 1f3555e6..5c04277f 100644 --- a/images/php-fpm/magento2/debug/Dockerfile +++ b/images/php-fpm/magento2/debug/Dockerfile @@ -3,9 +3,9 @@ FROM docker.io/wardenenv/php-fpm:${PHP_VERSION}-magento2 USER root RUN set -eux \ - && yum install -y php-pecl-xdebug \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y php-pecl-xdebug \ + && dnf clean all \ + && rm -rf /var/cache/dnf COPY debug/etc/*.ini /etc/ COPY debug/etc/php.d/*.ini /etc/php.d/ diff --git a/images/php-fpm/magento2/xdebug3/Dockerfile b/images/php-fpm/magento2/xdebug3/Dockerfile index 55e999d0..ac191097 100644 --- a/images/php-fpm/magento2/xdebug3/Dockerfile +++ b/images/php-fpm/magento2/xdebug3/Dockerfile @@ -3,9 +3,9 @@ FROM docker.io/wardenenv/php-fpm:${PHP_VERSION}-magento2 USER root RUN set -eux \ - && yum install -y php-pecl-xdebug3 \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y php-pecl-xdebug3 \ + && dnf clean all \ + && rm -rf /var/cache/dnf COPY xdebug3/etc/*.ini /etc/ COPY xdebug3/etc/php.d/*.ini /etc/php.d/ diff --git a/images/php-fpm/xdebug3/Dockerfile b/images/php-fpm/xdebug3/Dockerfile index 4adbd8e6..03622534 100644 --- a/images/php-fpm/xdebug3/Dockerfile +++ b/images/php-fpm/xdebug3/Dockerfile @@ -3,9 +3,9 @@ FROM docker.io/wardenenv/php-fpm:${PHP_VERSION} USER root RUN set -eux \ - && yum install -y php-pecl-xdebug3 \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y php-pecl-xdebug3 \ + && dnf clean all \ + && rm -rf /var/cache/dnf COPY xdebug3/etc/*.ini /etc/ COPY xdebug3/etc/php.d/*.ini /etc/php.d/ diff --git a/images/varnish/4.1/Dockerfile b/images/varnish/4.1/Dockerfile index fdfce340..7f1f0d17 100644 --- a/images/varnish/4.1/Dockerfile +++ b/images/varnish/4.1/Dockerfile @@ -1,15 +1,15 @@ FROM centos:7 -RUN yum upgrade -y \ - && yum clean all \ - && rm -rf /var/cache/yum +RUN dnf upgrade -y \ + && dnf clean all \ + && rm -rf /var/cache/dnf ARG RPM_SCRIPT=https://packagecloud.io/install/repositories/varnishcache/varnish41/script.rpm.sh RUN curl -s "${RPM_SCRIPT}" | bash \ - && yum install -y epel-release \ - && yum install -y varnish gettext \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y epel-release \ + && dnf install -y varnish gettext \ + && dnf clean all \ + && rm -rf /var/cache/dnf ENV VCL_CONFIG /etc/varnish/default.vcl ENV CACHE_SIZE 256m diff --git a/images/varnish/6.0/Dockerfile b/images/varnish/6.0/Dockerfile index 35efde72..e7523007 100644 --- a/images/varnish/6.0/Dockerfile +++ b/images/varnish/6.0/Dockerfile @@ -1,15 +1,15 @@ FROM centos:7 -RUN yum upgrade -y \ - && yum clean all \ - && rm -rf /var/cache/yum +RUN dnf upgrade -y \ + && dnf clean all \ + && rm -rf /var/cache/dnf ARG RPM_SCRIPT=https://packagecloud.io/install/repositories/varnishcache/varnish60lts/script.rpm.sh RUN curl -s "${RPM_SCRIPT}" | bash \ - && yum install -y epel-release \ - && yum install -y varnish gettext \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y epel-release \ + && dnf install -y varnish gettext \ + && dnf clean all \ + && rm -rf /var/cache/dnf ENV VCL_CONFIG /etc/varnish/default.vcl ENV CACHE_SIZE 256m diff --git a/images/varnish/6.4/Dockerfile b/images/varnish/6.4/Dockerfile index dd70dee2..6838d6c7 100644 --- a/images/varnish/6.4/Dockerfile +++ b/images/varnish/6.4/Dockerfile @@ -1,15 +1,15 @@ FROM centos:7 -RUN yum upgrade -y \ - && yum clean all \ - && rm -rf /var/cache/yum +RUN dnf upgrade -y \ + && dnf clean all \ + && rm -rf /var/cache/dnf ARG RPM_SCRIPT=https://packagecloud.io/install/repositories/varnishcache/varnish64/script.rpm.sh RUN curl -s "${RPM_SCRIPT}" | bash \ - && yum install -y epel-release \ - && yum install -y varnish gettext \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y epel-release \ + && dnf install -y varnish gettext \ + && dnf clean all \ + && rm -rf /var/cache/dnf ENV VCL_CONFIG /etc/varnish/default.vcl ENV CACHE_SIZE 256m diff --git a/images/varnish/6.5/Dockerfile b/images/varnish/6.5/Dockerfile index 639d6cc8..66e7cda9 100644 --- a/images/varnish/6.5/Dockerfile +++ b/images/varnish/6.5/Dockerfile @@ -1,15 +1,15 @@ FROM centos:7 -RUN yum upgrade -y \ - && yum clean all \ - && rm -rf /var/cache/yum +RUN dnf upgrade -y \ + && dnf clean all \ + && rm -rf /var/cache/dnf ARG RPM_SCRIPT=https://packagecloud.io/install/repositories/varnishcache/varnish65/script.rpm.sh RUN curl -s "${RPM_SCRIPT}" | bash \ - && yum install -y epel-release \ - && yum install -y varnish gettext \ - && yum clean all \ - && rm -rf /var/cache/yum + && dnf install -y epel-release \ + && dnf install -y varnish gettext \ + && dnf clean all \ + && rm -rf /var/cache/dnf ENV VCL_CONFIG /etc/varnish/default.vcl ENV CACHE_SIZE 256m From 278484dea48ed8cdb65e7dc3f355c06d4e87448d Mon Sep 17 00:00:00 2001 From: David Alger Date: Mon, 12 Apr 2021 13:43:16 -0500 Subject: [PATCH 07/20] Install python2 explicitly due to it's exclusion from EL 8 base image --- images/php-fpm/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/images/php-fpm/Dockerfile b/images/php-fpm/Dockerfile index 72910a17..729ba519 100644 --- a/images/php-fpm/Dockerfile +++ b/images/php-fpm/Dockerfile @@ -15,6 +15,11 @@ RUN dnf install -y which pv sudo bind-utils python3-pip bash-completion rsync so && dnf clean all \ && rm -rf /var/cache/dnf +RUN dnf install -y python2 \ + && ln -s /bin/python2 /bin/python \ + && dnf clean all \ + && rm -rf /var/cache/dnf + ENV NODE_VERSION 10 RUN npm install -g n \ && n install ${NODE_VERSION} \ From 32964a39248b7ba0957ea1e3394cb1f29401b90e Mon Sep 17 00:00:00 2001 From: David Alger Date: Mon, 12 Apr 2021 13:59:59 -0500 Subject: [PATCH 08/20] Moved mariadb install into main install transaction --- images/php-fpm/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/images/php-fpm/Dockerfile b/images/php-fpm/Dockerfile index 729ba519..5b3ede13 100644 --- a/images/php-fpm/Dockerfile +++ b/images/php-fpm/Dockerfile @@ -10,8 +10,7 @@ ENV MAILHOG_HOST mailhog ENV MAILHOG_PORT 1025 RUN dnf install -y which pv sudo bind-utils python3-pip bash-completion rsync socat oathtool \ - wget ack make gcc gcc-c++ automake autoconf crontabs \ - && dnf install -y mariadb \ + wget ack make gcc gcc-c++ automake autoconf crontabs mariadb \ && dnf clean all \ && rm -rf /var/cache/dnf From 3ebf66d78578bfc0bac32d9e640390fe4ab5ac91 Mon Sep 17 00:00:00 2001 From: David Alger Date: Tue, 13 Apr 2021 09:23:51 -0500 Subject: [PATCH 09/20] Updated base image for varnish images to EL 8 --- images/varnish/4.1/Dockerfile | 2 +- images/varnish/6.0/Dockerfile | 2 +- images/varnish/6.4/Dockerfile | 2 +- images/varnish/6.5/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/images/varnish/4.1/Dockerfile b/images/varnish/4.1/Dockerfile index 7f1f0d17..4e337107 100644 --- a/images/varnish/4.1/Dockerfile +++ b/images/varnish/4.1/Dockerfile @@ -1,4 +1,4 @@ -FROM centos:7 +FROM centos:8 RUN dnf upgrade -y \ && dnf clean all \ diff --git a/images/varnish/6.0/Dockerfile b/images/varnish/6.0/Dockerfile index e7523007..d096d649 100644 --- a/images/varnish/6.0/Dockerfile +++ b/images/varnish/6.0/Dockerfile @@ -1,4 +1,4 @@ -FROM centos:7 +FROM centos:8 RUN dnf upgrade -y \ && dnf clean all \ diff --git a/images/varnish/6.4/Dockerfile b/images/varnish/6.4/Dockerfile index 6838d6c7..45972ffe 100644 --- a/images/varnish/6.4/Dockerfile +++ b/images/varnish/6.4/Dockerfile @@ -1,4 +1,4 @@ -FROM centos:7 +FROM centos:8 RUN dnf upgrade -y \ && dnf clean all \ diff --git a/images/varnish/6.5/Dockerfile b/images/varnish/6.5/Dockerfile index 66e7cda9..12131c7c 100644 --- a/images/varnish/6.5/Dockerfile +++ b/images/varnish/6.5/Dockerfile @@ -1,4 +1,4 @@ -FROM centos:7 +FROM centos:8 RUN dnf upgrade -y \ && dnf clean all \ From fd1d3e68aa6487aa5962f1b220709aa00e35e850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Sch=C3=A4fer?= Date: Fri, 16 Apr 2021 15:44:17 +0200 Subject: [PATCH 10/20] Update customization docs --- docs/environments/customizing.md | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/environments/customizing.md b/docs/environments/customizing.md index 168ee2e8..8269c7b0 100644 --- a/docs/environments/customizing.md +++ b/docs/environments/customizing.md @@ -21,6 +21,44 @@ Start of some environments could be skipped by using variables in `.env` file: * `WARDEN_DB=0` * `WARDEN_REDIS=0` +### Docker Specific Customizations +To override default docker settings, add a custom configuration file in your project root +folder: `/.warden/warden-env.yml` +This file will be merged with the default environment configuration. +One example for a use case is [the setup of multiple domains](https://docs.warden.dev/configuration/multipledomains.html?highlight=warden%20env%20yml#multiple-domains). + +### PHP Specific Customizations +To override default php settings, follow the docker customization above and include your custom `php.ini` file. +In this case the `warden-env.yml` should look like this: + +``` +version: "3.5" +services: + php-fpm: + volumes: + - ./.warden/php/zz-config.ini:/etc/php.d/zz-config.ini + php-debug: + volumes: + - ./.warden/php/zz-config.ini:/etc/php.d/zz-config.ini +``` +Now add the referenced `.warden/php/zz-config.ini` file with your wanted changes. +For example you could change the error reporting value: +``` +error_reporting=(E_ALL ^ E_DEPRECATED) +``` +The config file will be merged with the default `01-php.ini` resp. override the values +included there. The default values are the following: +``` +date.timezone = UTC +max_execution_time = 3600 +max_input_vars = 10000 +memory_limit = 2G +display_errors = On +post_max_size = 25M +session.auto_start = Off +upload_max_filesize = 25M +``` + ### Magento 1 Specific Customizations If you use a `modman` structure, initialize the environment in your project path. From 37620701e9d8e0f79185b60206810a251e66ac88 Mon Sep 17 00:00:00 2001 From: David Alger Date: Tue, 20 Apr 2021 09:44:13 -0500 Subject: [PATCH 11/20] Drop php-fpm image builds for 5.5, 5.6, 7.0 and 7.1 --- .github/workflows/docker-image-php-fpm.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image-php-fpm.yml b/.github/workflows/docker-image-php-fpm.yml index 3af7118e..e277973f 100644 --- a/.github/workflows/docker-image-php-fpm.yml +++ b/.github/workflows/docker-image-php-fpm.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php_version: ["5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0"] + php_version: ["7.2", "7.3", "7.4", "8.0"] include: # IonCube and Source Guardian loaders do not yet exist for PHP 8.0 - php_version: "8.0" @@ -36,7 +36,7 @@ jobs: needs: php-fpm strategy: matrix: - php_version: ["5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0"] + php_version: ["7.2", "7.3", "7.4", "8.0"] steps: - uses: actions/checkout@v1 - run: ./images/scripts/build.sh --push "${BUILD_GROUP}" @@ -52,7 +52,7 @@ jobs: needs: php-fpm strategy: matrix: - php_version: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0"] + php_version: ["7.2", "7.3", "7.4", "8.0"] steps: - uses: actions/checkout@v1 - run: ./images/scripts/build.sh --push "${BUILD_GROUP}" From a5df5aa04e71527e7eebab0e602b151ff04e040d Mon Sep 17 00:00:00 2001 From: Timon de Groot Date: Thu, 22 Apr 2021 09:16:20 +0200 Subject: [PATCH 12/20] Update docs about DNS resolution using systemd-resolved --- docs/configuration/dns-resolver.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/configuration/dns-resolver.md b/docs/configuration/dns-resolver.md index 516fc43b..040f8462 100644 --- a/docs/configuration/dns-resolver.md +++ b/docs/configuration/dns-resolver.md @@ -21,7 +21,9 @@ If you desire to have more than this route through the `dnsmasq` container, you 1.0.0.1 ``` -#### Ubuntu systemd-resolved +#### systemd-resolved + +This approach works on most modern (systemd based) operating systems. `systemd-resolved` can we configured to forward the requests of `.test` TLD to another DNS server. The configuration file is typically located at `/etc/systemd/resolved.conf`. Change the file to contain the following lines. @@ -33,7 +35,7 @@ Domains=~test Restart the `systemd-resolved` ```bash -sudo service systemd-resolved restart +sudo systemctl restart systemd-resolved ``` #### Ubuntu resolvconf From fd9dcea8aa7e5e60b90efc1ad5277f709a8bce75 Mon Sep 17 00:00:00 2001 From: Timon de Groot Date: Thu, 22 Apr 2021 09:36:16 +0200 Subject: [PATCH 13/20] Update dns-resolver.md --- docs/configuration/dns-resolver.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/docs/configuration/dns-resolver.md b/docs/configuration/dns-resolver.md index 040f8462..26f0b6e7 100644 --- a/docs/configuration/dns-resolver.md +++ b/docs/configuration/dns-resolver.md @@ -25,18 +25,12 @@ If you desire to have more than this route through the `dnsmasq` container, you This approach works on most modern (systemd based) operating systems. -`systemd-resolved` can we configured to forward the requests of `.test` TLD to another DNS server. The configuration file is typically located at `/etc/systemd/resolved.conf`. Change the file to contain the following lines. +`systemd-resolved` can be configured to forward the requests of `.test` TLD to another DNS server. The configuration file is typically located at `/etc/systemd/resolved.conf` and `/etc/systemd/resolved.conf.d/*.conf`. Run the following commands to configure systemd-resolved: -```text -DNS=127.0.0.1 -Domains=~test -``` - -Restart the `systemd-resolved` - -```bash -sudo systemctl restart systemd-resolved -``` + sudo mkdir -p /etc/systemd/resolved.conf.d + echo -e "[Resolve]\nDNS=127.0.0.1\nDomains=~test\n" \ + | sudo tee /etc/systemd/resolved.conf.d/warden.conf > /dev/null + sudo systemctl restart systemctl-resolved #### Ubuntu resolvconf From 41927c6f4fbc454ead6ddf9c6d68a849df82204a Mon Sep 17 00:00:00 2001 From: Timon de Groot Date: Thu, 22 Apr 2021 17:48:50 +0200 Subject: [PATCH 14/20] Update dns-resolver.md --- docs/configuration/dns-resolver.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration/dns-resolver.md b/docs/configuration/dns-resolver.md index 26f0b6e7..0f137c06 100644 --- a/docs/configuration/dns-resolver.md +++ b/docs/configuration/dns-resolver.md @@ -30,7 +30,7 @@ This approach works on most modern (systemd based) operating systems. sudo mkdir -p /etc/systemd/resolved.conf.d echo -e "[Resolve]\nDNS=127.0.0.1\nDomains=~test\n" \ | sudo tee /etc/systemd/resolved.conf.d/warden.conf > /dev/null - sudo systemctl restart systemctl-resolved + sudo systemctl restart systemd-resolved #### Ubuntu resolvconf From d8a5090a0e5086a68d6b01d3676aac1a7fa5edca Mon Sep 17 00:00:00 2001 From: David Alger Date: Thu, 22 Apr 2021 14:46:41 -0500 Subject: [PATCH 15/20] Symfony and Shopware environments should default to Composer v2 Resolves #359 --- CHANGELOG.md | 4 ++++ commands/env-init.cmd | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ca70140..893cd438 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ ## UNRELEASED [x.y.z](https://github.com/davidalger/warden/tree/x.y.z) (yyyy-mm-dd) [All Commits](https://github.com/davidalger/warden/compare/0.10.2..develop) +**Enhancements:** + +* Shopware and Symfony environments will now use Composer v2 by default (issue [#359](https://github.com/davidalger/warden/issues/359)) + ## Version [0.10.2](https://github.com/davidalger/warden/tree/0.10.2) (2021-04-03) [All Commits](https://github.com/davidalger/warden/compare/0.10.1..0.10.2) diff --git a/commands/env-init.cmd b/commands/env-init.cmd index 0faeb539..5752f61a 100644 --- a/commands/env-init.cmd +++ b/commands/env-init.cmd @@ -154,7 +154,7 @@ if [[ "${WARDEN_ENV_TYPE}" =~ ^symfony|shopware$ ]]; then MARIADB_VERSION=10.4 NODE_VERSION=10 - COMPOSER_VERSION=1 + COMPOSER_VERSION=2 PHP_VERSION=7.4 PHP_XDEBUG_3=1 RABBITMQ_VERSION=3.8 From 09f520e1419d9de37a5303ed4b359fa7bbb3c322 Mon Sep 17 00:00:00 2001 From: David Alger Date: Thu, 22 Apr 2021 14:51:08 -0500 Subject: [PATCH 16/20] Update CL for #345 --- CHANGELOG.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 893cd438..287ac993 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,20 @@ # Change Log ## UNRELEASED [x.y.z](https://github.com/davidalger/warden/tree/x.y.z) (yyyy-mm-dd) -[All Commits](https://github.com/davidalger/warden/compare/0.10.2..develop) +[All Commits](https://github.com/davidalger/warden/compare/0.11.0..develop) + +## Version [0.11.0](https://github.com/davidalger/warden/tree/0.11.0) (2021-04-22) +[All Commits](https://github.com/davidalger/warden/compare/0.10.2..0.11.0) + +**Upgrade Notes:** + +PHP and Varnish images have been rebuilt on a CentOS 8 base image (previously used a CentOS 7 base image). This eliminates the need for IUS for installing Git and MariaDB clients as these can now be installed from the default EL RPMs. This also allows for constants supported by more recent versions of Curl to be used in PHP code, latest calendar / locale features available in newer versions of ICU libraries to be used, etc. + +To ensure you have the latest re-builds of Warden images and update your projects: `warden env pull && warden env up` + +For full details on what went into these rebuilds, please see [#345](https://github.com/davidalger/warden/pull/345). + +Huge shout out to @tdgroot who helped with updating the builds, testing, etc. **Enhancements:** From c405381187256ce86d51aaffa91d80bd57f81e05 Mon Sep 17 00:00:00 2001 From: David Alger Date: Thu, 22 Apr 2021 14:53:51 -0500 Subject: [PATCH 17/20] Update CL for #345 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 287ac993..6843ef95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ PHP and Varnish images have been rebuilt on a CentOS 8 base image (previously used a CentOS 7 base image). This eliminates the need for IUS for installing Git and MariaDB clients as these can now be installed from the default EL RPMs. This also allows for constants supported by more recent versions of Curl to be used in PHP code, latest calendar / locale features available in newer versions of ICU libraries to be used, etc. +Please note that builds for PHP versions 5.5, 5.6, 7.0 and 7.1 have been dropped. Images will remain on Docker Hub so they'll continue to be available for existing projects actively using them, they simply will see no further enhancements or maintenance. + To ensure you have the latest re-builds of Warden images and update your projects: `warden env pull && warden env up` For full details on what went into these rebuilds, please see [#345](https://github.com/davidalger/warden/pull/345). From 041c467896afd696f4b6df361bbb288f6a5bec81 Mon Sep 17 00:00:00 2001 From: David Alger Date: Thu, 22 Apr 2021 15:31:55 -0500 Subject: [PATCH 18/20] Move CORS policy into main rule --- .../context/etc/nginx/available.d/magento2.conf | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/images/nginx/context/etc/nginx/available.d/magento2.conf b/images/nginx/context/etc/nginx/available.d/magento2.conf index 2c5e41cc..e2edab81 100644 --- a/images/nginx/context/etc/nginx/available.d/magento2.conf +++ b/images/nginx/context/etc/nginx/available.d/magento2.conf @@ -67,9 +67,10 @@ location /static/ { rewrite ^/static/(version[^/]+/)?(.*)$ /static/$2 last; } - location ~* \.(ico|jpg|jpeg|png|gif|js|css|swf|json)$ { + location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|json)$ { add_header Cache-Control "public"; add_header X-Frame-Options "SAMEORIGIN"; + add_header Access-Control-Allow-Origin "*"; # Allow use from CDN origin expires +1y; if (!-f $request_filename) { @@ -77,16 +78,6 @@ location /static/ { } } - location ~* \.(eot|ttf|otf|svg|woff|woff2)$ { - add_header Access-Control-Allow-Origin *; - add_header Cache-Control "public"; - add_header X-Frame-Options "SAMEORIGIN"; - expires +1y; - if (!-f $request_filename) { - rewrite ^/static/?(.*)$ /static.php?resource=$1 last; - } - } - location ~* \.(zip|gz|gzip|bz2|csv|xml)$ { add_header Cache-Control "no-store"; add_header X-Frame-Options "SAMEORIGIN"; From 7a74b98978ab5a0e5ad31de11ecc7fe3aa84b272 Mon Sep 17 00:00:00 2001 From: David Alger Date: Thu, 22 Apr 2021 15:43:19 -0500 Subject: [PATCH 19/20] Prepare for 0.11.0 release --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 5eef0f10..d9df1bbc 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.10.2 +0.11.0 From 6631fba66114fd7e0d7cc4ca6337395deef9bbe8 Mon Sep 17 00:00:00 2001 From: David Alger Date: Thu, 22 Apr 2021 16:51:48 -0500 Subject: [PATCH 20/20] Added shopware 6 environment setup documentation --- README.md | 3 +- docs/configuration/mftf.md | 2 +- docs/configuration/multipledomains.md | 2 +- docs/environments.md | 3 +- docs/environments/customizing.md | 2 +- .../{initializing.md => magento2.md} | 128 +++++++++--------- docs/environments/shopware.md | 81 +++++++++++ 7 files changed, 149 insertions(+), 72 deletions(-) rename docs/environments/{initializing.md => magento2.md} (68%) create mode 100644 docs/environments/shopware.md diff --git a/README.md b/README.md index 8ddb039e..acde10e9 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,7 @@ Warden is a CLI utility for orchestrating Docker based developer environments, a * [Warden Website](https://warden.dev/) * [Warden Documentation](https://docs.warden.dev/) * [Installing Warden](https://docs.warden.dev/installing.html) -* [Environment Types](https://docs.warden.dev/environments/types.html) -* [Initializing An Environment](https://docs.warden.dev/environments/initializing.html) +* [Environment Types](https://docs.warden.dev/environments.html) * [Docker Images](https://docs.warden.dev/images.html) ## Features diff --git a/docs/configuration/mftf.md b/docs/configuration/mftf.md index 69693d4d..0449e1e0 100644 --- a/docs/configuration/mftf.md +++ b/docs/configuration/mftf.md @@ -21,7 +21,7 @@ We provide complex instruction on [How to run MFTF Tests](magento2-testing.html# ### Debugging MFTF Tests -By default Warden uses headless Chrome browser. If you want to preview the tests - you need to extend `.env` file and update environment containers (`warden env up -d`) +By default Warden uses headless Chrome browser. If you want to preview the tests - you need to extend `.env` file and update environment containers (`warden env up`) ``` WARDEN_SELENIUM_DEBUG=1 diff --git a/docs/configuration/multipledomains.md b/docs/configuration/multipledomains.md index 5e835ede..8232e9ef 100644 --- a/docs/configuration/multipledomains.md +++ b/docs/configuration/multipledomains.md @@ -36,7 +36,7 @@ Multiple top-level domains may also be setup by following the instructions below 3. Configure the application to handle traffic coming from each of these domains appropriately. An example on this for Magento 2 environments may be found below. -4. Run `warden env up -d` to update the containers, after which each of the URLs should work as expected. +4. Run `warden env up` to update the containers, after which each of the URLs should work as expected. ``` note:: If these alternate domains must be resolvable from within the FPM containers, you must also leverage ``extra_hosts`` to add each specific sub-domain to the ``/etc/hosts`` file of the container as dnsmasq is used only on the host machine, not inside the containers. This should look something like the following excerpt. diff --git a/docs/environments.md b/docs/environments.md index 44323b88..d453083d 100644 --- a/docs/environments.md +++ b/docs/environments.md @@ -6,6 +6,7 @@ :glob: environments/types - environments/initializing + environments/magento2 + environments/shopware environments/* ``` diff --git a/docs/environments/customizing.md b/docs/environments/customizing.md index 8269c7b0..7b3e0cbc 100644 --- a/docs/environments/customizing.md +++ b/docs/environments/customizing.md @@ -2,7 +2,7 @@ Further information on customizing or extending an environment is forthcoming. For now, this section is limited to very simple and somewhat common customizations. -To configure your project with a non-default PHP version, add the following to the project's `.env` file and run `warden env up -d` to re-create the affected containers: +To configure your project with a non-default PHP version, add the following to the project's `.env` file and run `warden env up` to re-create the affected containers: PHP_VERSION=7.2 diff --git a/docs/environments/initializing.md b/docs/environments/magento2.md similarity index 68% rename from docs/environments/initializing.md rename to docs/environments/magento2.md index 8ba5ef99..2c58e5cd 100644 --- a/docs/environments/initializing.md +++ b/docs/environments/magento2.md @@ -1,92 +1,88 @@ -## Initializing An Environment +## Installing Magento 2 The below example demonstrates the from-scratch setup of the Magento 2 application for local development. A similar process can easily be used to configure an environment of any other type. This assumes that Warden has been previously started via `warden svc up` as part of the installation procedure. -``` note:: +```note:: In addition to the below manual process, there is a `Github Template available for Magento 2 `_ allowing for quick setup of new Magento projects. To use this, click the green "Use this template" button to create your own repository based on the template repository, run the init script and update the README with any project specific information. ``` -1. Create a new directory on your host machine at the location of your choice and then jump into the new directory to get started: +1. Create a new directory on your host machine at the location of your choice and then jump into the new directory to get started: - mkdir -p ~/Sites/exampleproject - cd ~/Sites/exampleproject + mkdir -p ~/Sites/exampleproject + cd ~/Sites/exampleproject -2. From the root of your new project directory, run `env-init` to create the `.env` file with configuration needed for Warden and Docker to work with the project. +2. From the root of your new project directory, run `env-init` to create the `.env` file with configuration needed for Warden and Docker to work with the project. - warden env-init exampleproject magento2 + warden env-init exampleproject magento2 The result of this command is a `.env` file in the project root (tip: commit this to your VCS to share the configuration with other team members) having the following contents: - WARDEN_ENV_NAME=exampleproject - WARDEN_ENV_TYPE=magento2 - WARDEN_WEB_ROOT=/ + WARDEN_ENV_NAME=exampleproject + WARDEN_ENV_TYPE=magento2 + WARDEN_WEB_ROOT=/ - TRAEFIK_DOMAIN=exampleproject.test - TRAEFIK_SUBDOMAIN=app + TRAEFIK_DOMAIN=exampleproject.test + TRAEFIK_SUBDOMAIN=app - WARDEN_DB=1 - WARDEN_ELASTICSEARCH=1 - WARDEN_VARNISH=1 - WARDEN_RABBITMQ=1 - WARDEN_REDIS=1 + WARDEN_DB=1 + WARDEN_ELASTICSEARCH=1 + WARDEN_VARNISH=1 + WARDEN_RABBITMQ=1 + WARDEN_REDIS=1 - WARDEN_SYNC_IGNORE= + WARDEN_SYNC_IGNORE= - ELASTICSEARCH_VERSION=7.6 - MARIADB_VERSION=10.3 - NODE_VERSION=10 - COMPOSER_VERSION=1 - PHP_VERSION=7.3 - PHP_XDEBUG_3=1 - RABBITMQ_VERSION=3.8 - REDIS_VERSION=5.0 - VARNISH_VERSION=6.0 + ELASTICSEARCH_VERSION=7.6 + MARIADB_VERSION=10.3 + NODE_VERSION=10 + COMPOSER_VERSION=1 + PHP_VERSION=7.3 + PHP_XDEBUG_3=1 + RABBITMQ_VERSION=3.8 + REDIS_VERSION=5.0 + VARNISH_VERSION=6.0 - WARDEN_ALLURE=0 - WARDEN_SELENIUM=0 - WARDEN_SELENIUM_DEBUG=0 - WARDEN_BLACKFIRE=0 - WARDEN_SPLIT_SALES=0 - WARDEN_SPLIT_CHECKOUT=0 - WARDEN_TEST_DB=0 - WARDEN_MAGEPACK=0 - - BLACKFIRE_CLIENT_ID= - BLACKFIRE_CLIENT_TOKEN= - BLACKFIRE_SERVER_ID= - BLACKFIRE_SERVER_TOKEN= + WARDEN_ALLURE=0 + WARDEN_SELENIUM=0 + WARDEN_SELENIUM_DEBUG=0 + WARDEN_BLACKFIRE=0 + WARDEN_SPLIT_SALES=0 + WARDEN_SPLIT_CHECKOUT=0 + WARDEN_TEST_DB=0 + WARDEN_MAGEPACK=0 -3. Sign an SSL certificate for use with the project (the input here should match the value of `TRAEFIK_DOMAIN` in the above `.env` example file): + BLACKFIRE_CLIENT_ID= + BLACKFIRE_CLIENT_TOKEN= + BLACKFIRE_SERVER_ID= + BLACKFIRE_SERVER_TOKEN= - warden sign-certificate exampleproject.test +3. Sign an SSL certificate for use with the project (the input here should match the value of `TRAEFIK_DOMAIN` in the above `.env` example file): -4. Next you'll want to start the project environment: + warden sign-certificate exampleproject.test - warden env up -d +4. Next you'll want to start the project environment: - ``` warning:: - If you encounter an error about ``Mounts denied``, follow the instructions in the error message and run ``warden env up -d`` again. - ``` + warden env up - ``` note:: - On macOS when using Warden versions prior to 0.3.0, you will need to start the Mutagen sync session manually be running ``warden sync start`` whenever starting the environment. In Warden 0.3.0 and later the sync session is started and stopped automatically when running commands such as ``up``, ``start``, ``down``, and ``stop``. - ``` + ```warning:: + If you encounter an error about ``Mounts denied``, follow the instructions in the error message and run ``warden env up`` again. + ``` -5. Drop into a shell within the project environment. Commands following this step in the setup procedure will be run from within the `php-fpm` docker container this launches you into: +5. Drop into a shell within the project environment. Commands following this step in the setup procedure will be run from within the `php-fpm` docker container this launches you into: - warden shell + warden shell -6. Configure global Magento Marketplace credentials +6. Configure global Magento Marketplace credentials - composer global config http-basic.repo.magento.com + composer global config http-basic.repo.magento.com - ``` note:: + ```note:: To locate your authentication keys for Magento 2 repository, `reference DevDocs `_. If you have previously configured global credentials, you may skip this step, as ``~/.composer/`` is mounted into the container from the host machine in order to share composer cache between projects, and also shares the global ``auth.json`` from the host machine. ``` - 7. Initialize project source files using composer create-project and then move them into place: +7. Initialize project source files using composer create-project and then move them into place: META_PACKAGE=magento/project-community-edition META_VERSION=2.4.x @@ -96,7 +92,7 @@ The below example demonstrates the from-scratch setup of the Magento 2 applicati rsync -a /tmp/exampleproject/ /var/www/html/ rm -rf /tmp/exampleproject/ - 8. Install the application and you should be all set: +8. Install the application and you should be all set: ## Install Application bin/magento setup:install \ @@ -156,7 +152,7 @@ The below example demonstrates the from-scratch setup of the Magento 2 applicati bin/magento indexer:reindex bin/magento cache:flush - ``` note:: + ```note:: Prior to Magento ``2.4.x`` it was not required to enter search-engine and elasticsearch configuration during installation and these params to ``setup:install`` are not supported by Magento ``2.3.x``. These should be omitted on older versions where not supported and Elasticsearch configured via ``config:set`` instead: .. code:: @@ -169,7 +165,7 @@ The below example demonstrates the from-scratch setup of the Magento 2 applicati bin/magento config:set --lock-env catalog/search/elasticsearch7_server_timeout 15 ``` - 9. Generate an admin user and configure 2FA for OTP +9. Generate an admin user and configure 2FA for OTP ## Generate localadmin user ADMIN_PASS="$(pwgen -n1 16)" @@ -199,17 +195,17 @@ The below example demonstrates the from-scratch setup of the Magento 2 applicati segno "${OTPAUTH_URL}" -s 4 -o "pub/media/${ADMIN_USER}-totp-qr.png" printf "%s\n\n" "https://${TRAEFIK_SUBDOMAIN}.${TRAEFIK_DOMAIN}/media/${ADMIN_USER}-totp-qr.png?t=$(date +%s)" - ``` note:: + ```note:: Use of 2FA is mandatory on Magento ``2.4.x`` and setup of 2FA should be skipped when installing ``2.3.x`` or earlier. Where 2FA is setup manually via UI upon login rather than using the CLI commands above, the 2FA configuration email may be retrieved from `the Mailhog service `_. ``` - 10. Launch the application in your browser: +10. Launch the application in your browser: - * [https://app.exampleproject.test/](https://app.exampleproject.test/) - * [https://app.exampleproject.test/backend/](https://app.exampleproject.test/backend/) - * [https://rabbitmq.exampleproject.test/](https://rabbitmq.exampleproject.test/) - * [https://elasticsearch.exampleproject.test/](https://elasticsearch.exampleproject.test/) + - [https://app.exampleproject.test/](https://app.exampleproject.test/) + - [https://app.exampleproject.test/backend/](https://app.exampleproject.test/backend/) + - [https://rabbitmq.exampleproject.test/](https://rabbitmq.exampleproject.test/) + - [https://elasticsearch.exampleproject.test/](https://elasticsearch.exampleproject.test/) -``` note:: +```note:: To completely destroy the ``exampleproject`` environment we just created, run ``warden env down -v`` to tear down the project's Docker containers, volumes, etc. ``` diff --git a/docs/environments/shopware.md b/docs/environments/shopware.md new file mode 100644 index 00000000..80a4dade --- /dev/null +++ b/docs/environments/shopware.md @@ -0,0 +1,81 @@ +## Installing Shopware 6 + +The below example demonstrates the from-scratch setup of the Shopware 6 application for local development. A similar process can easily be used to configure an environment of any other type. This assumes that Warden has been previously started via `warden svc up` as part of the installation procedure. + +1. Create a new directory on your host machine at the location of your choice and then jump into the new directory to get started: + + mkdir -p ~/Sites/exampleproject + cd ~/Sites/exampleproject + +2. From the root of your new project directory, run `env-init` to create the `.env` file with configuration needed for Warden and Docker to work with the project. + + warden env-init exampleproject shopware + + The result of this command is a `.env` file in the project root (tip: commit this to your VCS to share the configuration with other team members) having the following contents: + + WARDEN_ENV_NAME=exampleproject + WARDEN_ENV_TYPE=shopware + WARDEN_WEB_ROOT=/ + + TRAEFIK_DOMAIN=exampleproject.test + TRAEFIK_SUBDOMAIN=app + + WARDEN_DB=1 + WARDEN_REDIS=1 + WARDEN_RABBITMQ=0 + WARDEN_ELASTICSEARCH=0 + WARDEN_VARNISH=0 + + MARIADB_VERSION=10.4 + NODE_VERSION=10 + COMPOSER_VERSION=2 + PHP_VERSION=7.4 + PHP_XDEBUG_3=1 + RABBITMQ_VERSION=3.8 + REDIS_VERSION=5.0 + VARNISH_VERSION=6.0 + +3. Sign an SSL certificate for use with the project (the input here should match the value of `TRAEFIK_DOMAIN` in the above `.env` example file): + + warden sign-certificate exampleproject.test + +4. Configure the project to use `./webroot` so the Shopware installer won't overwrite Warden's `.env` file + + perl -pi -e 's#^WARDEN_WEB_ROOT.*#WARDEN_WEB_ROOT=/webroot#' .env + +5. Clone the Shopware development template + + git clone git@github.com:shopware/development.git ./webroot + +6. Next you'll want to start the project environment: + + warden env up + + ```warning:: + If you encounter an error about ``Mounts denied``, follow the instructions in the error message and run ``warden env up`` again. + ``` + +7. Drop into a shell within the project environment. Commands following this step in the setup procedure will be run from within the `php-fpm` docker container this launches you into: + + warden shell + +8. Configure the `APP_URL` Shopware will use during installation: + + echo $'const:\n APP_URL: "https://app.exampleproject.test"\n' > .psh.yaml.override + +9. Install the Shopware application complete with sample data: + + ./psh.phar install + +10. Launch the application in your browser: + + - [https://app.exampleproject.test/](https://app.exampleproject.test/) + - [https://app.exampleproject.test/admin/](https://app.exampleproject.test/admin/) + +```note:: + The default username for Shopware 6 is ``admin`` with password ``shopware``. +``` + +```note:: + To completely destroy the ``exampleproject`` environment we just created, run ``warden env down -v`` to tear down the project's Docker containers, volumes, etc. +```