diff --git a/composer.json b/composer.json index c93df5a9..0fb17f2b 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.4.1", + "version": "1.4.4", "license": [ "OSL-3.0", "AFL-3.0" @@ -12,11 +12,11 @@ "ext-json": "*", "composer/composer": "^1.9 || ^2.8 || !=2.2.16", "composer/semver": "@stable", - "illuminate/config": "^8.77 || ^10.0 || ^11.0", - "symfony/config": "^4.4 || ^5.1|| ^5.4 || ^6.4", - "symfony/console": "^4.4 || ^5.1 || ^5.4 || ^6.4", - "symfony/dependency-injection": "^4.4 || ^5.1|| ^5.4 || ^6.4", - "symfony/yaml": "^4.4 || ^5.1 || ^5.4|| ^6.4" + "illuminate/config": "^8.77 || ^10.0 || ^11.0 || ^12.16", + "symfony/config": "^4.4 || ^5.1|| ^5.4 || ^6.4 || ^7.2", + "symfony/console": "^4.4 || ^5.1 || ^5.4 || ^6.4 || ^7.2", + "symfony/dependency-injection": "^4.4 || ^5.1|| ^5.4 || ^6.4 || ^7.2", + "symfony/yaml": "^4.4 || ^5.1 || ^5.4|| ^6.4 || ^7.2" }, "require-dev": { "codeception/codeception": "^4.1 || ^5.1", @@ -24,7 +24,7 @@ "codeception/module-db": "^1.0 || ^3.0", "codeception/module-phpbrowser": "^1.0 || ^3.0", "codeception/module-rest": "^1.2 || ^3.0", - "consolidation/robo": "^2.0 || ^3.0", + "consolidation/robo": "^2.0 || ^3.0 || ^4.0 || ^5.0", "phpmd/phpmd": "@stable", "phpstan/phpstan": "^1.8 || ^2.0", "phpunit/phpunit": "^10.0", diff --git a/config/services.xml b/config/services.xml index 9dc5ae85..319f8350 100644 --- a/config/services.xml +++ b/config/services.xml @@ -24,6 +24,7 @@ + diff --git a/images/opensearch/1.3/Dockerfile b/images/opensearch/1.3/Dockerfile index ee27282e..66ea8c91 100644 --- a/images/opensearch/1.3/Dockerfile +++ b/images/opensearch/1.3/Dockerfile @@ -1,11 +1,5 @@ FROM opensearchproject/opensearch:1.3.0 -USER root -RUN yum -y install zip && \ - zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache USER opensearch RUN bin/opensearch-plugin install -b analysis-icu && \ diff --git a/images/opensearch/2.12/Dockerfile b/images/opensearch/2.12/Dockerfile index 976c19fd..613d3c58 100644 --- a/images/opensearch/2.12/Dockerfile +++ b/images/opensearch/2.12/Dockerfile @@ -1,11 +1,5 @@ FROM opensearchproject/opensearch:2.12.0 -USER root -RUN yum -y install zip && \ - zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache USER opensearch RUN bin/opensearch-plugin install -b analysis-icu && \ diff --git a/images/opensearch/2.3/Dockerfile b/images/opensearch/2.3/Dockerfile index 1f52e728..cbdac08a 100644 --- a/images/opensearch/2.3/Dockerfile +++ b/images/opensearch/2.3/Dockerfile @@ -1,11 +1,5 @@ FROM opensearchproject/opensearch:2.3.0 -USER root -RUN yum -y install zip && \ - zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache USER opensearch RUN bin/opensearch-plugin install -b analysis-icu && \ diff --git a/images/opensearch/2.4/Dockerfile b/images/opensearch/2.4/Dockerfile index b38adc78..945c59a8 100644 --- a/images/opensearch/2.4/Dockerfile +++ b/images/opensearch/2.4/Dockerfile @@ -1,11 +1,5 @@ FROM opensearchproject/opensearch:2.4.0 -USER root -RUN yum -y install zip && \ - zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache USER opensearch RUN bin/opensearch-plugin install -b analysis-icu && \ diff --git a/images/opensearch/2.5/Dockerfile b/images/opensearch/2.5/Dockerfile index a1b197fa..fbf3067c 100644 --- a/images/opensearch/2.5/Dockerfile +++ b/images/opensearch/2.5/Dockerfile @@ -1,11 +1,5 @@ FROM opensearchproject/opensearch:2.5.0 -USER root -RUN yum -y install zip && \ - zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ - yum remove -y zip && \ - yum -y clean all && \ - rm -rf /var/cache USER opensearch RUN bin/opensearch-plugin install -b analysis-icu && \ diff --git a/images/opensearch/3.0/Dockerfile b/images/opensearch/3.0/Dockerfile new file mode 100644 index 00000000..2b2e876b --- /dev/null +++ b/images/opensearch/3.0/Dockerfile @@ -0,0 +1,15 @@ +FROM opensearchproject/opensearch:3.0.0 + +USER opensearch + +RUN bin/opensearch-plugin install -b analysis-icu && \ + bin/opensearch-plugin install -b analysis-phonetic + +ADD docker-healthcheck.sh /docker-healthcheck.sh +ADD docker-entrypoint.sh /docker-entrypoint.sh + +HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9200 9300 diff --git a/images/opensearch/3.0/docker-entrypoint.sh b/images/opensearch/3.0/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/3.0/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if [[ -n "$OS_PLUGINS" ]]; then + echo "Installing plugins: $OS_PLUGINS" + for PLUGIN in $OS_PLUGINS + do + ./bin/opensearch-plugin install -b "$PLUGIN" + done +fi + +/bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh diff --git a/images/opensearch/3.0/docker-healthcheck.sh b/images/opensearch/3.0/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/3.0/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then + health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") + if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then + exit 0 + fi + echo >&2 "Unexpected health status: $health" +fi + +exit 1 diff --git a/images/php/7.4-cli/Dockerfile b/images/php/7.4-cli/Dockerfile deleted file mode 100644 index 949519b7..00000000 --- a/images/php/7.4-cli/Dockerfile +++ /dev/null @@ -1,225 +0,0 @@ -# This file is automatically generated. Do not edit directly. # -FROM golang:1.15 AS builder - -RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ - && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ - && tar -xf mhsendmail.tar.gz \ - && mkdir -p ./src/github.com/mailhog/ \ - && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ - && cd ./src/github.com/mailhog/mhsendmail/ \ - && go get . \ - && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . - -FROM php:7.4-cli - -ARG COMPOSER_VERSION=1.10.22 -ARG MAGENTO_ROOT=/app -ARG COMPOSER_ALLOW_SUPERUSER=1 -ARG COMPOSER_HOME=/composer -ARG CRONTAB="" - -ENV COMPOSER_MEMORY_LIMIT -1 -ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} -ENV COMPOSER_HOME ${COMPOSER_HOME} -ENV COMPOSER_CLEAR_CACHE false -ENV PHP_MEMORY_LIMIT -1 -ENV PHP_VALIDATE_TIMESTAMPS 1 -ENV DEBUG false -ENV MAGENTO_RUN_MODE production -ENV SENDMAIL_PATH /dev/null -ENV PHPRC ${MAGENTO_ROOT}/php.ini - -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl - -# Configure Node.js version -RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - -# Install dependencies -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - apt-utils \ - cron \ - git \ - mariadb-client \ - nano \ - nodejs \ - python3 \ - python3-pip \ - redis-tools \ - sendmail-bin \ - sendmail \ - sudo \ - unzip \ - vim \ - openssh-client \ - gnupg2 \ - ca-certificates \ - lsb-release \ - software-properties-common \ - libbz2-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libfreetype6-dev \ - libgeoip-dev \ - wget \ - libgmp-dev \ - libgpgme11-dev \ - libmagickwand-dev \ - libmagickcore-dev \ - libicu-dev \ - libldap2-dev \ - libpspell-dev \ - libtidy-dev \ - libxslt1-dev \ - libyaml-dev \ - libzip-dev \ - zip \ - && rm -rf /var/lib/apt/lists/* - -# Install Python packages -RUN pip3 install --upgrade setuptools && pip3 install pyyaml - -# Install Grunt -RUN npm install -g grunt-cli - -# Install MailHog -COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ -RUN sudo chmod +x /usr/local/bin/mhsendmail - -# Configure the gd library -RUN docker-php-ext-configure \ - gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ -RUN docker-php-ext-configure \ - opcache --enable-opcache - -# Install required PHP extensions -RUN docker-php-ext-install -j$(nproc) \ - bcmath \ - bz2 \ - calendar \ - exif \ - gd \ - gettext \ - gmp \ - intl \ - mysqli \ - opcache \ - pdo_mysql \ - pspell \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - tidy \ - xmlrpc \ - xsl \ - zip \ - pcntl - -RUN pecl install -o -f \ - geoip-1.1.1 \ - gnupg \ - igbinary \ - imagick \ - mailparse \ - msgpack \ - oauth \ - pcov \ - propro \ - raphf \ - redis \ - xdebug-3.1.2 \ - yaml - -RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ - && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ - && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ - && apt-get update \ - && apt-get install blackfire-php \ - && rm -rf /var/lib/apt/lists/* -RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ - && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} -RUN mkdir -p /tmp/zoo \ - && cd /tmp/zoo \ - && git clone https://github.com/php-zookeeper/php-zookeeper.git \ - && curl -LO https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz \ - && tar -xf zookeeper-3.4.14.tar.gz \ - && cp zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/generated/zookeeper.jute.h zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/include \ - && cd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && ./configure \ - && sed -i 's/CFLAGS = -g -O2 -D_GNU_SOURCE/CFLAGS = -g -O2 -D_GNU_SOURCE -Wno-error=format-overflow -Wno-error=stringop-truncation/g' Makefile \ - && make \ - && make install \ - && ldconfig \ - && cd /tmp/zoo/php-zookeeper \ - && phpize \ - && ./configure --with-libzookeeper-dir=../zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && make \ - && make install -RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ - && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ - && apt-get remove libsodium* -y \ - && mkdir -p /tmp/libsodium \ - && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ - && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ - && ./configure \ - && make && make check \ - && make install \ - && cd / \ - && rm -rf /tmp/libsodium \ - && pecl install -o -f libsodium -RUN cd /tmp \ - && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ - && export PHP_EXT_DIR=$(php-config --extension-dir) \ - && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ - && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz - -ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini -ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini -ADD etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini -ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini -ADD etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini - -# Get composer installed to /usr/local/bin/composer -RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --version=${COMPOSER_VERSION} --filename=composer - -ADD bin/* /usr/local/bin/ - -RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www - -ADD docker-entrypoint.sh /docker-entrypoint.sh - -RUN ["chmod", "+x", \ - "/docker-entrypoint.sh", \ - "/usr/local/bin/magento-installer", \ - "/usr/local/bin/magento-command", \ - "/usr/local/bin/mftf-command", \ - "/usr/local/bin/ece-command", \ - "/usr/local/bin/cloud-build", \ - "/usr/local/bin/cloud-deploy", \ - "/usr/local/bin/cloud-post-deploy", \ - "/usr/local/bin/run-cron", \ - "/usr/local/bin/run-hooks" \ -] - -RUN mkdir -p ${MAGENTO_ROOT} - -VOLUME ${MAGENTO_ROOT} - -RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} -RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi - -ENTRYPOINT ["/docker-entrypoint.sh"] - -WORKDIR ${MAGENTO_ROOT} - -USER root - -CMD ["bash"] diff --git a/images/php/7.4-fpm/Dockerfile b/images/php/7.4-fpm/Dockerfile deleted file mode 100644 index 2c085a62..00000000 --- a/images/php/7.4-fpm/Dockerfile +++ /dev/null @@ -1,183 +0,0 @@ -# This file is automatically generated. Do not edit directly. # -FROM golang:1.15 AS builder - -RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ - && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ - && tar -xf mhsendmail.tar.gz \ - && mkdir -p ./src/github.com/mailhog/ \ - && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ - && cd ./src/github.com/mailhog/mhsendmail/ \ - && go get . \ - && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . - -FROM php:7.4-fpm - -ARG MAGENTO_ROOT=/app - -ENV PHP_MEMORY_LIMIT 2G -ENV PHP_VALIDATE_TIMESTAMPS 1 -ENV DEBUG false -ENV MAGENTO_RUN_MODE production -ENV UPLOAD_MAX_FILESIZE 64M -ENV SENDMAIL_PATH /dev/null -ENV PHPRC ${MAGENTO_ROOT}/php.ini - -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl - -# Install dependencies -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - apt-utils \ - sendmail-bin \ - sendmail \ - sudo \ - iproute2 \ - git \ - gnupg2 \ - ca-certificates \ - lsb-release \ - software-properties-common \ - libbz2-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libfreetype6-dev \ - libgeoip-dev \ - wget \ - libgmp-dev \ - libgpgme11-dev \ - libmagickwand-dev \ - libmagickcore-dev \ - libicu-dev \ - libldap2-dev \ - libpspell-dev \ - libtidy-dev \ - libxslt1-dev \ - libyaml-dev \ - libzip-dev \ - zip \ - && rm -rf /var/lib/apt/lists/* - -# Install MailHog -COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ -RUN sudo chmod +x /usr/local/bin/mhsendmail - -# Configure the gd library -RUN docker-php-ext-configure \ - gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ -RUN docker-php-ext-configure \ - opcache --enable-opcache - -# Install required PHP extensions -RUN docker-php-ext-install -j$(nproc) \ - bcmath \ - bz2 \ - calendar \ - exif \ - gd \ - gettext \ - gmp \ - intl \ - mysqli \ - opcache \ - pdo_mysql \ - pspell \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - tidy \ - xmlrpc \ - xsl \ - zip \ - pcntl - -RUN pecl install -o -f \ - geoip-1.1.1 \ - gnupg \ - igbinary \ - imagick \ - mailparse \ - msgpack \ - oauth \ - pcov \ - propro \ - raphf \ - redis \ - xdebug-3.1.2 \ - yaml - -RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ - && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ - && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ - && apt-get update \ - && apt-get install blackfire-php \ - && rm -rf /var/lib/apt/lists/* -RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ - && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} -RUN mkdir -p /tmp/zoo \ - && cd /tmp/zoo \ - && git clone https://github.com/php-zookeeper/php-zookeeper.git \ - && curl -LO https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz \ - && tar -xf zookeeper-3.4.14.tar.gz \ - && cp zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/generated/zookeeper.jute.h zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/include \ - && cd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && ./configure \ - && sed -i 's/CFLAGS = -g -O2 -D_GNU_SOURCE/CFLAGS = -g -O2 -D_GNU_SOURCE -Wno-error=format-overflow -Wno-error=stringop-truncation/g' Makefile \ - && make \ - && make install \ - && ldconfig \ - && cd /tmp/zoo/php-zookeeper \ - && phpize \ - && ./configure --with-libzookeeper-dir=../zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && make \ - && make install -RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ - && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ - && apt-get remove libsodium* -y \ - && mkdir -p /tmp/libsodium \ - && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ - && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ - && ./configure \ - && make && make check \ - && make install \ - && cd / \ - && rm -rf /tmp/libsodium \ - && pecl install -o -f libsodium -RUN cd /tmp \ - && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ - && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ - && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ - && export PHP_EXT_DIR=$(php-config --extension-dir) \ - && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ - && rm -rf ./ioncube \ - && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz - -COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini -COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini -COPY etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini -COPY etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini -COPY etc/php-fpm.conf /usr/local/etc/ -COPY etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini - -RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www - -COPY docker-entrypoint.sh /docker-entrypoint.sh -RUN ["chmod", "+x", "/docker-entrypoint.sh"] - -RUN mkdir -p ${MAGENTO_ROOT} - -VOLUME ${MAGENTO_ROOT} - -RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d ${MAGENTO_ROOT} - -ENTRYPOINT ["/docker-entrypoint.sh"] - -WORKDIR ${MAGENTO_ROOT} - -USER root - -CMD ["php-fpm", "-R"] diff --git a/images/php/8.0-cli/bin/cloud-build b/images/php/8.0-cli/bin/cloud-build deleted file mode 100644 index bbd584c9..00000000 --- a/images/php/8.0-cli/bin/cloud-build +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -RUN_HOOKS="run-hooks" - -if [ "$MAGENTO_RUN_MODE" == "production" ]; then - echo "Cleaning directories:" - - if [ "$INSTALLATION_TYPE" == "composer" ]; then - echo "Cleaning setup directory." - rm -rf $MAGENTO_ROOT/setup/* - fi - - echo "Cleaning vendor directory." - rm -rf $MAGENTO_ROOT/vendor/* - - echo "Cleaning generated directory." - rm -rf $MAGENTO_ROOT/generated/* - - echo "Removing app/etc/env.php file" - rm -f $MAGENTO_ROOT/app/etc/env.php -fi - -echo "Installing dependencies." - -composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist - -echo "Running \"build\" hook." - -$RUN_HOOKS build - -if [ "$MAGENTO_RUN_MODE" == "production" ]; then - echo "Setting file permissions." - - chown -R www:www $MAGENTO_ROOT - - find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; - find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; -fi - -echo "Building complete." diff --git a/images/php/8.0-cli/bin/cloud-deploy b/images/php/8.0-cli/bin/cloud-deploy deleted file mode 100644 index f6b891bf..00000000 --- a/images/php/8.0-cli/bin/cloud-deploy +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -echo "Running \"deploy\" hook." - -run-hooks deploy - -# check that Varnish exists -if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then - minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") - if [[ "$minor_magento_version" != "2.1" ]]; then - output=$(magento-command config:set system/full_page_cache/caching_application 2) - # as config:set does not return error code, we check output text to continue set varnish settings - if [[ $output == *"Value was saved"* ]]; then - echo "Setting Varnish for Magento FPC." - magento-command setup:config:set --http-cache-hosts=varnish -n - else - echo $output - fi - fi -fi - -# set developer mode if it is configured in $MAGENTO_RUN_MODE -if [ "$MAGENTO_RUN_MODE" == "developer" ]; then - output=$(magento-command deploy:mode:set developer) - if [[ $output == *"Enabled developer mode."* ]]; then - echo "Enabled developer mode." - else - echo $output - fi -fi - - -echo "Deployment finished." diff --git a/images/php/8.0-cli/bin/cloud-post-deploy b/images/php/8.0-cli/bin/cloud-post-deploy deleted file mode 100644 index f5bb3956..00000000 --- a/images/php/8.0-cli/bin/cloud-post-deploy +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -echo "Running \"post-deploy\" hook." - -run-hooks post_deploy - -echo "Post deployment finished." diff --git a/images/php/8.0-cli/bin/ece-command b/images/php/8.0-cli/bin/ece-command deleted file mode 100644 index 36d896c5..00000000 --- a/images/php/8.0-cli/bin/ece-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" - -exec $ECE_COMMAND "$@" diff --git a/images/php/8.0-cli/bin/magento-command b/images/php/8.0-cli/bin/magento-command deleted file mode 100644 index 8d439f7d..00000000 --- a/images/php/8.0-cli/bin/magento-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" - -exec $MAGENTO_COMMAND "$@" diff --git a/images/php/8.0-cli/bin/magento-installer b/images/php/8.0-cli/bin/magento-installer deleted file mode 100644 index 73645ab7..00000000 --- a/images/php/8.0-cli/bin/magento-installer +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -[ "$DEBUG" = "true" ] && set -x - -BUILD_COMMAND="cloud-build" -DEPLOY_COMMAND="cloud-deploy" - -$BUILD_COMMAND -$DEPLOY_COMMAND diff --git a/images/php/8.0-cli/bin/mftf-command b/images/php/8.0-cli/bin/mftf-command deleted file mode 100644 index 88eaa1df..00000000 --- a/images/php/8.0-cli/bin/mftf-command +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" - -exec $MFTF_COMMAND "$@" diff --git a/images/php/8.0-cli/bin/run-cron b/images/php/8.0-cli/bin/run-cron deleted file mode 100644 index f6554a5c..00000000 --- a/images/php/8.0-cli/bin/run-cron +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -cron && tail -f -n0 /var/log/cron.log diff --git a/images/php/8.0-cli/bin/run-hooks b/images/php/8.0-cli/bin/run-hooks deleted file mode 100644 index 8ac215c9..00000000 --- a/images/php/8.0-cli/bin/run-hooks +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import subprocess -import json -import base64 - -# Disable output buffering. -os.environ['PYTHONUNBUFFERED'] = "1" - -# The list of available hooks. -available_hooks = ["build", "deploy", "post_deploy"] - - -# Prints a message and returns an exit code. -def error_exit(msg, code=1): - print(msg) - sys.exit(code) - - -# Gets Magento root path. -def get_magento_root(): - try: - return str(os.environ['MAGENTO_ROOT']) - except KeyError: - error_exit('Environment variable MAGENTO_ROOT is not available') - - -# Gets set hooks by hook name. -def get_hooks(hook_name): - try: - application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) - content = json.loads(base64.b64decode(application).decode("utf-8")) - - return content['hooks'][hook_name] - except Exception as exc: - error_exit("Cannot decode string: " + str(exc)) - - -# Main function. -def main(): - if len(sys.argv) != 2: - error_exit("Usage: run-hooks ") - - hook_name = str(sys.argv[1]) - if hook_name not in available_hooks: - error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) - - try: - subprocess.check_call( - get_hooks(hook_name), - shell=True, - cwd=get_magento_root() - ) - except subprocess.CalledProcessError as exc: - error_exit("returned non-zero exit status " + str(exc.returncode)) - - -if __name__ == '__main__': - main() diff --git a/images/php/8.0-cli/docker-entrypoint.sh b/images/php/8.0-cli/docker-entrypoint.sh deleted file mode 100644 index ee380b80..00000000 --- a/images/php/8.0-cli/docker-entrypoint.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -if [ ! -z "${CRONTAB}" ]; then - echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log -fi - -PHP_EXT_DIR=/usr/local/etc/php/conf.d - -# Enable PHP extensions -PHP_EXT_COM_ON=docker-php-ext-enable - -[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini - -if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then - ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} -fi - -# Clear composer cache if needed -[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ - composer clearcache - -# Configure composer -[ ! -z "${COMPOSER_VERSION}" ] && \ - composer self-update $COMPOSER_VERSION - -[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ - composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN - -[ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ - composer config --global http-basic.repo.magento.com \ - $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD - -exec "$@" diff --git a/images/php/8.0-cli/etc/mail.ini b/images/php/8.0-cli/etc/mail.ini deleted file mode 100644 index c1620288..00000000 --- a/images/php/8.0-cli/etc/mail.ini +++ /dev/null @@ -1,2 +0,0 @@ -; Sendmail -sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.0-cli/etc/php-cli.ini b/images/php/8.0-cli/etc/php-cli.ini deleted file mode 100644 index dfaf04e4..00000000 --- a/images/php/8.0-cli/etc/php-cli.ini +++ /dev/null @@ -1,10 +0,0 @@ -; php.ini -memory_limit = ${PHP_MEMORY_LIMIT} -zlib.output_compression = on -realpath_cache_size = 32k -realpath_cache_ttl = 7200 -always_populate_raw_post_data = -1 -max_input_vars = 10000 -session.gc_probability = 1 -opcache.enable = 1 -opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} diff --git a/images/php/8.0-cli/etc/php-gnupg.ini b/images/php/8.0-cli/etc/php-gnupg.ini deleted file mode 100644 index f0f7e9a7..00000000 --- a/images/php/8.0-cli/etc/php-gnupg.ini +++ /dev/null @@ -1 +0,0 @@ -extension = gnupg.so diff --git a/images/php/8.0-cli/etc/php-pcov.ini b/images/php/8.0-cli/etc/php-pcov.ini deleted file mode 100644 index a9f0145a..00000000 --- a/images/php/8.0-cli/etc/php-pcov.ini +++ /dev/null @@ -1,2 +0,0 @@ -pcov.enabled = 1 -pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.0-cli/etc/php-xdebug.ini b/images/php/8.0-cli/etc/php-xdebug.ini deleted file mode 100644 index 57b1bd9f..00000000 --- a/images/php/8.0-cli/etc/php-xdebug.ini +++ /dev/null @@ -1,8 +0,0 @@ -; Xdebug settings will only kick in if the Xdebug module is loaded -xdebug.mode = debug -xdebug.client_port = 9001 -xdebug.start_with_request = trigger -xdebug.discover_client_host = false -xdebug.scream = false -xdebug.show_local_vars = 1 -xdebug.idekey = PHPSTORM diff --git a/images/php/8.0-fpm/docker-entrypoint.sh b/images/php/8.0-fpm/docker-entrypoint.sh deleted file mode 100644 index 0c8c5c9c..00000000 --- a/images/php/8.0-fpm/docker-entrypoint.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -[ "$DEBUG" = "true" ] && set -x - -PHP_EXT_DIR=/usr/local/etc/php/conf.d - -# Enable PHP extensions -PHP_EXT_COM_ON=docker-php-ext-enable - -[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini - -if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then - ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} -fi - -# Set host.docker.internal if not available -HOST_NAME="host.docker.internal" -HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") -if [[ "$HOST_IP" == "$HOST_NAME" ]]; then - HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') - printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts -fi - -exec "$@" diff --git a/images/php/8.0-fpm/etc/mail.ini b/images/php/8.0-fpm/etc/mail.ini deleted file mode 100644 index c1620288..00000000 --- a/images/php/8.0-fpm/etc/mail.ini +++ /dev/null @@ -1,2 +0,0 @@ -; Sendmail -sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.0-fpm/etc/php-fpm.conf b/images/php/8.0-fpm/etc/php-fpm.conf deleted file mode 100644 index d988b314..00000000 --- a/images/php/8.0-fpm/etc/php-fpm.conf +++ /dev/null @@ -1,25 +0,0 @@ -[global] - -error_log = /proc/self/fd/2 -daemonize = no - -[www] - -; if we send this to /proc/self/fd/1, it never appears -access.log = /proc/self/fd/2 - -listen = [::]:9000 - -pm = dynamic -pm.max_children = 10 -pm.start_servers = 4 -pm.min_spare_servers = 2 -pm.max_spare_servers = 6 -pm.status_path = /status - -clear_env = no - -env[MAGE_MODE] = $MAGENTO_RUN_MODE - -; Ensure worker stdout and stderr are sent to the main error log. -catch_workers_output = yes diff --git a/images/php/8.0-fpm/etc/php-fpm.ini b/images/php/8.0-fpm/etc/php-fpm.ini deleted file mode 100644 index 387c8aeb..00000000 --- a/images/php/8.0-fpm/etc/php-fpm.ini +++ /dev/null @@ -1,4 +0,0 @@ -memory_limit = ${PHP_MEMORY_LIMIT} -opcache.enable = 1 -opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} -user_ini.filename = diff --git a/images/php/8.0-fpm/etc/php-gnupg.ini b/images/php/8.0-fpm/etc/php-gnupg.ini deleted file mode 100644 index f0f7e9a7..00000000 --- a/images/php/8.0-fpm/etc/php-gnupg.ini +++ /dev/null @@ -1 +0,0 @@ -extension = gnupg.so diff --git a/images/php/8.0-fpm/etc/php-pcov.ini b/images/php/8.0-fpm/etc/php-pcov.ini deleted file mode 100644 index a9f0145a..00000000 --- a/images/php/8.0-fpm/etc/php-pcov.ini +++ /dev/null @@ -1,2 +0,0 @@ -pcov.enabled = 1 -pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.0-fpm/etc/php-xdebug.ini b/images/php/8.0-fpm/etc/php-xdebug.ini deleted file mode 100644 index 57b1bd9f..00000000 --- a/images/php/8.0-fpm/etc/php-xdebug.ini +++ /dev/null @@ -1,8 +0,0 @@ -; Xdebug settings will only kick in if the Xdebug module is loaded -xdebug.mode = debug -xdebug.client_port = 9001 -xdebug.start_with_request = trigger -xdebug.discover_client_host = false -xdebug.scream = false -xdebug.show_local_vars = 1 -xdebug.idekey = PHPSTORM diff --git a/images/php/8.0-cli/Dockerfile b/images/php/8.4-cli/Dockerfile similarity index 76% rename from images/php/8.0-cli/Dockerfile rename to images/php/8.4-cli/Dockerfile index 03ddcad2..d04d9411 100644 --- a/images/php/8.0-cli/Dockerfile +++ b/images/php/8.4-cli/Dockerfile @@ -10,26 +10,47 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= && go get . \ && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . -FROM php:8.0.14-cli +FROM php:8.4-cli -ARG COMPOSER_VERSION=2.2.23 +ARG COMPOSER_VERSION=2.8.4 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer ARG CRONTAB="" -ENV COMPOSER_MEMORY_LIMIT -1 -ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} -ENV COMPOSER_HOME ${COMPOSER_HOME} -ENV COMPOSER_CLEAR_CACHE false -ENV PHP_MEMORY_LIMIT -1 -ENV PHP_VALIDATE_TIMESTAMPS 1 -ENV DEBUG false -ENV MAGENTO_RUN_MODE production -ENV SENDMAIL_PATH /dev/null -ENV PHPRC ${MAGENTO_ROOT}/php.ini - -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl +ENV COMPOSER_MEMORY_LIMIT=-1 +ENV COMPOSER_ALLOW_SUPERUSER=${COMPOSER_ALLOW_SUPERUSER} +ENV COMPOSER_HOME=${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE=false +ENV PHP_MEMORY_LIMIT=-1 +ENV PHP_VALIDATE_TIMESTAMPS=1 +ENV DEBUG=false +ENV MAGENTO_RUN_MODE=production +ENV SENDMAIL_PATH=/dev/null +ENV PHPRC=${MAGENTO_ROOT}/php.ini + +ENV PHP_EXTENSIONS="\ + bcmath \ + bz2 \ + calendar \ + exif \ + gd \ + gettext \ + intl \ + mysqli \ + opcache \ + pdo_mysql \ + redis \ + soap \ + sockets \ + sodium \ + sysvmsg \ + sysvsem \ + sysvshm \ + xsl \ + zip \ + pcntl \ + ftp" # Configure Node.js version RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash @@ -72,10 +93,11 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ + python3-yaml \ && rm -rf /var/lib/apt/lists/* # Install Python packages -RUN pip3 install --upgrade setuptools && pip3 install pyyaml + # Install Grunt RUN npm install -g grunt-cli @@ -103,7 +125,6 @@ RUN docker-php-ext-install -j$(nproc) \ mysqli \ opcache \ pdo_mysql \ - pspell \ shmop \ soap \ sockets \ @@ -113,7 +134,8 @@ RUN docker-php-ext-install -j$(nproc) \ tidy \ xsl \ zip \ - pcntl + pcntl \ + ftp RUN pecl install -o -f \ gnupg \ @@ -123,9 +145,10 @@ RUN pecl install -o -f \ pcov \ raphf \ redis \ - xdebug-3.1.2 \ + xdebug-3.4.0 \ xmlrpc-1.0.0RC3 \ - yaml + yaml \ + pspell RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ @@ -135,23 +158,6 @@ RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io && rm -rf /var/lib/apt/lists/* RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} -RUN mkdir -p /tmp/zoo \ - && cd /tmp/zoo \ - && git clone https://github.com/php-zookeeper/php-zookeeper.git \ - && curl -LO https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz \ - && tar -xf zookeeper-3.4.14.tar.gz \ - && cp zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/generated/zookeeper.jute.h zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/include \ - && cd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && ./configure \ - && sed -i 's/CFLAGS = -g -O2 -D_GNU_SOURCE/CFLAGS = -g -O2 -D_GNU_SOURCE -Wno-error=format-overflow -Wno-error=stringop-truncation/g' Makefile \ - && make \ - && make install \ - && ldconfig \ - && cd /tmp/zoo/php-zookeeper \ - && phpize \ - && ./configure --with-libzookeeper-dir=../zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && make \ - && make install RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ && apt-get remove libsodium* -y \ diff --git a/images/php/7.4-cli/bin/cloud-build b/images/php/8.4-cli/bin/cloud-build similarity index 100% rename from images/php/7.4-cli/bin/cloud-build rename to images/php/8.4-cli/bin/cloud-build diff --git a/images/php/7.4-cli/bin/cloud-deploy b/images/php/8.4-cli/bin/cloud-deploy similarity index 100% rename from images/php/7.4-cli/bin/cloud-deploy rename to images/php/8.4-cli/bin/cloud-deploy diff --git a/images/php/7.4-cli/bin/cloud-post-deploy b/images/php/8.4-cli/bin/cloud-post-deploy similarity index 100% rename from images/php/7.4-cli/bin/cloud-post-deploy rename to images/php/8.4-cli/bin/cloud-post-deploy diff --git a/images/php/7.4-cli/bin/ece-command b/images/php/8.4-cli/bin/ece-command similarity index 100% rename from images/php/7.4-cli/bin/ece-command rename to images/php/8.4-cli/bin/ece-command diff --git a/images/php/7.4-cli/bin/magento-command b/images/php/8.4-cli/bin/magento-command similarity index 100% rename from images/php/7.4-cli/bin/magento-command rename to images/php/8.4-cli/bin/magento-command diff --git a/images/php/7.4-cli/bin/magento-installer b/images/php/8.4-cli/bin/magento-installer similarity index 100% rename from images/php/7.4-cli/bin/magento-installer rename to images/php/8.4-cli/bin/magento-installer diff --git a/images/php/7.4-cli/bin/mftf-command b/images/php/8.4-cli/bin/mftf-command similarity index 100% rename from images/php/7.4-cli/bin/mftf-command rename to images/php/8.4-cli/bin/mftf-command diff --git a/images/php/7.4-cli/bin/run-cron b/images/php/8.4-cli/bin/run-cron similarity index 100% rename from images/php/7.4-cli/bin/run-cron rename to images/php/8.4-cli/bin/run-cron diff --git a/images/php/7.4-cli/bin/run-hooks b/images/php/8.4-cli/bin/run-hooks similarity index 100% rename from images/php/7.4-cli/bin/run-hooks rename to images/php/8.4-cli/bin/run-hooks diff --git a/images/php/7.4-cli/docker-entrypoint.sh b/images/php/8.4-cli/docker-entrypoint.sh similarity index 100% rename from images/php/7.4-cli/docker-entrypoint.sh rename to images/php/8.4-cli/docker-entrypoint.sh diff --git a/images/php/7.4-cli/etc/mail.ini b/images/php/8.4-cli/etc/mail.ini similarity index 100% rename from images/php/7.4-cli/etc/mail.ini rename to images/php/8.4-cli/etc/mail.ini diff --git a/images/php/7.4-cli/etc/php-cli.ini b/images/php/8.4-cli/etc/php-cli.ini similarity index 100% rename from images/php/7.4-cli/etc/php-cli.ini rename to images/php/8.4-cli/etc/php-cli.ini diff --git a/images/php/7.4-cli/etc/php-gnupg.ini b/images/php/8.4-cli/etc/php-gnupg.ini similarity index 100% rename from images/php/7.4-cli/etc/php-gnupg.ini rename to images/php/8.4-cli/etc/php-gnupg.ini diff --git a/images/php/7.4-cli/etc/php-pcov.ini b/images/php/8.4-cli/etc/php-pcov.ini similarity index 100% rename from images/php/7.4-cli/etc/php-pcov.ini rename to images/php/8.4-cli/etc/php-pcov.ini diff --git a/images/php/7.4-cli/etc/php-xdebug.ini b/images/php/8.4-cli/etc/php-xdebug.ini similarity index 100% rename from images/php/7.4-cli/etc/php-xdebug.ini rename to images/php/8.4-cli/etc/php-xdebug.ini diff --git a/images/php/8.0-fpm/Dockerfile b/images/php/8.4-fpm/Dockerfile similarity index 74% rename from images/php/8.0-fpm/Dockerfile rename to images/php/8.4-fpm/Dockerfile index c97994d6..1e610bef 100644 --- a/images/php/8.0-fpm/Dockerfile +++ b/images/php/8.4-fpm/Dockerfile @@ -10,19 +10,40 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= && go get . \ && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . -FROM php:8.0.14-fpm +FROM php:8.4-fpm ARG MAGENTO_ROOT=/app -ENV PHP_MEMORY_LIMIT 2G -ENV PHP_VALIDATE_TIMESTAMPS 1 -ENV DEBUG false -ENV MAGENTO_RUN_MODE production -ENV UPLOAD_MAX_FILESIZE 64M -ENV SENDMAIL_PATH /dev/null -ENV PHPRC ${MAGENTO_ROOT}/php.ini +ENV PHP_MEMORY_LIMIT=2G +ENV PHP_VALIDATE_TIMESTAMPS=1 +ENV DEBUG=false +ENV MAGENTO_RUN_MODE=production +ENV UPLOAD_MAX_FILESIZE=64M +ENV SENDMAIL_PATH=/dev/null +ENV PHPRC=${MAGENTO_ROOT}/php.ini -ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl +ENV PHP_EXTENSIONS="\ + bcmath \ + bz2 \ + calendar \ + exif \ + gd \ + gettext \ + intl \ + mysqli \ + opcache \ + pdo_mysql \ + redis \ + soap \ + sockets \ + sodium \ + sysvmsg \ + sysvsem \ + sysvshm \ + xsl \ + zip \ + pcntl \ + ftp" # Install dependencies RUN apt-get update \ @@ -53,6 +74,7 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ + python3-yaml \ && rm -rf /var/lib/apt/lists/* # Install MailHog @@ -78,7 +100,6 @@ RUN docker-php-ext-install -j$(nproc) \ mysqli \ opcache \ pdo_mysql \ - pspell \ shmop \ soap \ sockets \ @@ -88,7 +109,8 @@ RUN docker-php-ext-install -j$(nproc) \ tidy \ xsl \ zip \ - pcntl + pcntl \ + ftp RUN pecl install -o -f \ gnupg \ @@ -98,9 +120,10 @@ RUN pecl install -o -f \ pcov \ raphf \ redis \ - xdebug-3.1.2 \ + xdebug-3.4.0 \ xmlrpc-1.0.0RC3 \ - yaml + yaml \ + pspell RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ @@ -110,23 +133,6 @@ RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io && rm -rf /var/lib/apt/lists/* RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} -RUN mkdir -p /tmp/zoo \ - && cd /tmp/zoo \ - && git clone https://github.com/php-zookeeper/php-zookeeper.git \ - && curl -LO https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz \ - && tar -xf zookeeper-3.4.14.tar.gz \ - && cp zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/generated/zookeeper.jute.h zookeeper-3.4.14/zookeeper-client/zookeeper-client-c/include \ - && cd zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && ./configure \ - && sed -i 's/CFLAGS = -g -O2 -D_GNU_SOURCE/CFLAGS = -g -O2 -D_GNU_SOURCE -Wno-error=format-overflow -Wno-error=stringop-truncation/g' Makefile \ - && make \ - && make install \ - && ldconfig \ - && cd /tmp/zoo/php-zookeeper \ - && phpize \ - && ./configure --with-libzookeeper-dir=../zookeeper-3.4.14/zookeeper-client/zookeeper-client-c \ - && make \ - && make install RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ && apt-get remove libsodium* -y \ diff --git a/images/php/7.4-fpm/docker-entrypoint.sh b/images/php/8.4-fpm/docker-entrypoint.sh similarity index 100% rename from images/php/7.4-fpm/docker-entrypoint.sh rename to images/php/8.4-fpm/docker-entrypoint.sh diff --git a/images/php/7.4-fpm/etc/mail.ini b/images/php/8.4-fpm/etc/mail.ini similarity index 100% rename from images/php/7.4-fpm/etc/mail.ini rename to images/php/8.4-fpm/etc/mail.ini diff --git a/images/php/7.4-fpm/etc/php-fpm.conf b/images/php/8.4-fpm/etc/php-fpm.conf similarity index 100% rename from images/php/7.4-fpm/etc/php-fpm.conf rename to images/php/8.4-fpm/etc/php-fpm.conf diff --git a/images/php/7.4-fpm/etc/php-fpm.ini b/images/php/8.4-fpm/etc/php-fpm.ini similarity index 100% rename from images/php/7.4-fpm/etc/php-fpm.ini rename to images/php/8.4-fpm/etc/php-fpm.ini diff --git a/images/php/7.4-fpm/etc/php-gnupg.ini b/images/php/8.4-fpm/etc/php-gnupg.ini similarity index 100% rename from images/php/7.4-fpm/etc/php-gnupg.ini rename to images/php/8.4-fpm/etc/php-gnupg.ini diff --git a/images/php/7.4-fpm/etc/php-pcov.ini b/images/php/8.4-fpm/etc/php-pcov.ini similarity index 100% rename from images/php/7.4-fpm/etc/php-pcov.ini rename to images/php/8.4-fpm/etc/php-pcov.ini diff --git a/images/php/7.4-fpm/etc/php-xdebug.ini b/images/php/8.4-fpm/etc/php-xdebug.ini similarity index 100% rename from images/php/7.4-fpm/etc/php-xdebug.ini rename to images/php/8.4-fpm/etc/php-xdebug.ini diff --git a/src/Command/BuildCompose.php b/src/Command/BuildCompose.php index 0059dcda..1dca9c56 100644 --- a/src/Command/BuildCompose.php +++ b/src/Command/BuildCompose.php @@ -138,6 +138,11 @@ protected function configure(): void null, InputOption::VALUE_REQUIRED, 'Redis version' + )->addOption( + Source\CliSource::OPTION_VALKEY, + null, + InputOption::VALUE_REQUIRED, + 'Valkey version' )->addOption( Source\CliSource::OPTION_ES, null, @@ -188,6 +193,16 @@ protected function configure(): void null, InputOption::VALUE_NONE, 'Disable Opensearch' + )->addOption( + Source\CliSource::OPTION_NO_REDIS, + null, + InputOption::VALUE_NONE, + 'Disable Redis' + )->addOption( + Source\CliSource::OPTION_NO_DB, + null, + InputOption::VALUE_NONE, + 'Disable Database' )->addOption( Source\CliSource::OPTION_NO_MAILHOG, null, diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index 75523b66..fcaf1f6a 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -26,13 +26,14 @@ class GeneratePhp extends Command { private const NAME = 'image:generate:php'; - private const SUPPORTED_VERSIONS = ['8.0', '8.1', '8.2', '8.3']; + private const SUPPORTED_VERSIONS = ['8.0', '8.1', '8.2', '8.3', '8.4']; private const VERSION_MAP = [ '8.0' => '8.0.14', '8.1' => '8.1.1', '8.2' => '8.2', - '8.3' => '8.3' + '8.3' => '8.3', + '8.4' => '8.4' ]; private const EDITION_CLI = 'cli'; @@ -87,7 +88,8 @@ class GeneratePhp extends Command 'opcache', 'xsl', 'zip', - 'sodium' + 'sodium', + 'ftp' ]; private const DOCKERFILE = 'Dockerfile'; diff --git a/src/Compose/BuilderInterface.php b/src/Compose/BuilderInterface.php index ecfba36e..a31a394b 100644 --- a/src/Compose/BuilderInterface.php +++ b/src/Compose/BuilderInterface.php @@ -29,6 +29,7 @@ interface BuilderInterface public const SERVICE_TLS = ServiceInterface::SERVICE_TLS; public const SERVICE_RABBITMQ = ServiceInterface::SERVICE_RABBITMQ; public const SERVICE_REDIS = ServiceInterface::SERVICE_REDIS; + public const SERVICE_VALKEY = ServiceInterface::SERVICE_VALKEY; public const SERVICE_ELASTICSEARCH = ServiceInterface::SERVICE_ELASTICSEARCH; public const SERVICE_OPENSEARCH = ServiceInterface::SERVICE_OPENSEARCH; public const SERVICE_NODE = ServiceInterface::SERVICE_NODE; diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index a5971adf..f9a82d0e 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -50,6 +50,7 @@ class ExtensionResolver // Required for Magento 2.4.0+ 'xsl', 'sodium', + 'ftp' ]; /** @@ -62,7 +63,7 @@ class ExtensionResolver 'dom' => '>=7.0', 'fileinfo' => '>=7.0', 'filter' => '>=7.0', - 'ftp' => '>=7.0', + 'ftp' => '>=7.0 <8.2', 'hash' => '>=7.0', 'iconv' => '>=7.0', 'json' => '>=7.0', @@ -435,6 +436,10 @@ public static function getConfig(): array self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, self::EXTENSION_PACKAGE_NAME => 'xdebug-3.3.0', ], + '>=8.4' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, + self::EXTENSION_PACKAGE_NAME => 'xdebug-3.4.0', + ], ], 'xmlrpc' => [ '>=7.0 <8.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], @@ -490,6 +495,11 @@ public static function getConfig(): array BASH ], ], + 'ftp' => [ + '>=8.2' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE, + ], + ], ]; } } diff --git a/src/Compose/ProductionBuilder/CliDepend.php b/src/Compose/ProductionBuilder/CliDepend.php index 46abe017..c79b0a26 100644 --- a/src/Compose/ProductionBuilder/CliDepend.php +++ b/src/Compose/ProductionBuilder/CliDepend.php @@ -27,6 +27,9 @@ class CliDepend BuilderInterface::SERVICE_REDIS => [ 'condition' => 'service_healthy' ], + BuilderInterface::SERVICE_VALKEY => [ + 'condition' => 'service_healthy' + ], BuilderInterface::SERVICE_ELASTICSEARCH => [ 'condition' => 'service_healthy' ], diff --git a/src/Compose/ProductionBuilder/Service/Database/Db/HealthCheck.php b/src/Compose/ProductionBuilder/Service/Database/Db/HealthCheck.php index f3ae6cdf..3c9eb951 100644 --- a/src/Compose/ProductionBuilder/Service/Database/Db/HealthCheck.php +++ b/src/Compose/ProductionBuilder/Service/Database/Db/HealthCheck.php @@ -20,7 +20,10 @@ class HealthCheck public function getConfig(): array { return [ - 'test' => 'mysqladmin ping -h localhost -pmagento2', + 'test' => [ + 'CMD-SHELL', + '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' + ], 'interval' => '30s', 'timeout' => '30s', 'retries' => 3 diff --git a/src/Compose/ProductionBuilder/Service/Valkey.php b/src/Compose/ProductionBuilder/Service/Valkey.php new file mode 100644 index 00000000..150a54d8 --- /dev/null +++ b/src/Compose/ProductionBuilder/Service/Valkey.php @@ -0,0 +1,93 @@ +serviceFactory = $serviceFactory; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return BuilderInterface::SERVICE_VALKEY; + } + + /** + * @inheritDoc + */ + public function getServiceName(): string + { + return $this->getName(); + } + + /** + * @inheritDoc + */ + public function getConfig(Config $config): array + { + $configArray = $this->serviceFactory->create( + $this->getServiceName(), + $config->getServiceVersion($this->getServiceName()), + [ + BuilderInterface::SERVICE_HEALTHCHECK => [ + 'test' => 'valkey-cli ping || exit 1', + 'interval' => '30s', + 'timeout' => '30s', + 'retries' => 3 + ] + ], + $config->getServiceImage($this->getServiceName()), + $config->getCustomRegistry() + ); + + // Set both 'cache' and 'valkey.magento2.docker' as aliases unconditionally + $configArray['networks'][BuilderInterface::NETWORK_MAGENTO]['aliases'] = [ + 'cache', + 'valkey.magento2.docker' + ]; + + return $configArray; + } + + /** + * @inheritDoc + */ + public function getNetworks(): array + { + return [BuilderInterface::NETWORK_MAGENTO]; + } + + /** + * @inheritDoc + */ + public function getDependsOn(Config $config): array + { + return []; + } +} diff --git a/src/Config/Relationship.php b/src/Config/Relationship.php index c98edcf9..c22e4c3e 100644 --- a/src/Config/Relationship.php +++ b/src/Config/Relationship.php @@ -55,6 +55,12 @@ class Relationship 'port' => '6379' ] ], + 'valkey' => [ + [ + 'host' => 'cache', + 'port' => '6379' + ] + ], 'elasticsearch' => [ [ 'host' => 'elasticsearch', diff --git a/src/Config/Source/CliSource.php b/src/Config/Source/CliSource.php index 9cd66345..1d2d8e6b 100644 --- a/src/Config/Source/CliSource.php +++ b/src/Config/Source/CliSource.php @@ -27,6 +27,7 @@ class CliSource implements SourceInterface public const OPTION_EXPOSE_DB_QUOTE_PORT = 'expose-db-quote-port'; public const OPTION_EXPOSE_DB_SALES_PORT = 'expose-db-sales-port'; public const OPTION_REDIS = 'redis'; + public const OPTION_VALKEY = 'valkey'; public const OPTION_ES = 'es'; public const OPTION_OS = 'os'; public const OPTION_RABBIT_MQ = 'rmq'; @@ -37,6 +38,8 @@ class CliSource implements SourceInterface public const OPTION_INSTALLATION_TYPE = 'installation-type'; public const OPTION_NO_ES = 'no-es'; public const OPTION_NO_OS = 'no-os'; + public const OPTION_NO_REDIS = 'no-redis'; + public const OPTION_NO_DB = 'no-db'; public const OPTION_NO_MAILHOG = 'no-mailhog'; public const OPTION_NO_TLS = 'no-tls'; @@ -124,6 +127,9 @@ class CliSource implements SourceInterface self::OPTION_REDIS => [ self::SERVICES_REDIS => true ], + self::OPTION_VALKEY => [ + self::SERVICES_VALKEY => true + ], self::OPTION_ES => [ self::SERVICES_ES => true ], @@ -146,6 +152,8 @@ class CliSource implements SourceInterface private static $disableOptionsMap = [ self::OPTION_NO_ES => self::SERVICES_ES, self::OPTION_NO_OS => self::SERVICES_OS, + self::OPTION_NO_REDIS => self::SERVICES_REDIS, + self::OPTION_NO_DB => self::SERVICES_DB, self::OPTION_NO_MAILHOG => self::SERVICES_MAILHOG, self::OPTION_NO_TLS => self::SERVICES_TLS, ]; diff --git a/src/Config/Source/CloudSource.php b/src/Config/Source/CloudSource.php index 2d2ddc8d..2e9e3712 100644 --- a/src/Config/Source/CloudSource.php +++ b/src/Config/Source/CloudSource.php @@ -47,6 +47,7 @@ class CloudSource implements SourceInterface ServiceInterface::SERVICE_ELASTICSEARCH => ['elasticsearch', 'es'], ServiceInterface::SERVICE_OPENSEARCH => ['opensearch', 'os'], ServiceInterface::SERVICE_REDIS => ['redis'], + ServiceInterface::SERVICE_VALKEY => ['cache','valkey'], ServiceInterface::SERVICE_RABBITMQ => ['rmq', 'rabbitmq'] ]; diff --git a/src/Config/Source/SourceInterface.php b/src/Config/Source/SourceInterface.php index 9456293d..292a35ce 100644 --- a/src/Config/Source/SourceInterface.php +++ b/src/Config/Source/SourceInterface.php @@ -73,6 +73,11 @@ interface SourceInterface */ public const SERVICES_REDIS = self::SERVICES . '.' . ServiceInterface::SERVICE_REDIS; + /** + * Valkey + */ + public const SERVICES_VALKEY = self::SERVICES . '.' . ServiceInterface::SERVICE_VALKEY; + /** * ES */ diff --git a/src/Service/ServiceFactory.php b/src/Service/ServiceFactory.php index d45d94b8..119fcc51 100644 --- a/src/Service/ServiceFactory.php +++ b/src/Service/ServiceFactory.php @@ -105,6 +105,26 @@ class ServiceFactory ] ], ], + ServiceInterface::SERVICE_VALKEY => [ + 'image' => 'valkey/valkey', + 'pattern' => self::PATTERN_STD, + 'config' => [ + 'volumes' => [ + '/data', + ], + 'ports' => [6379], + 'sysctls' => [ + 'net.core.somaxconn' => 1024, + ], + 'ulimits' => [ + 'nproc' => 65535, + 'nofile' => [ + 'soft' => 20000, + 'hard' => 40000 + ], + ] + ], + ], ServiceInterface::SERVICE_ELASTICSEARCH => [ 'image' => 'magento/magento-cloud-docker-elasticsearch', 'pattern' => self::PATTERN_VERSIONED, diff --git a/src/Service/ServiceInterface.php b/src/Service/ServiceInterface.php index 4ee3be2b..54936094 100644 --- a/src/Service/ServiceInterface.php +++ b/src/Service/ServiceInterface.php @@ -23,6 +23,7 @@ interface ServiceInterface public const SERVICE_DB_SALES = 'mysql-sales'; public const SERVICE_NGINX = 'nginx'; public const SERVICE_REDIS = 'redis'; + public const SERVICE_VALKEY = 'valkey'; public const SERVICE_ELASTICSEARCH = 'elasticsearch'; public const SERVICE_OPENSEARCH = 'opensearch'; public const SERVICE_RABBITMQ = 'rabbitmq'; diff --git a/src/Test/Functional/Acceptance/AbstractCest.php b/src/Test/Functional/Acceptance/AbstractCest.php index 14f5e603..1a446852 100644 --- a/src/Test/Functional/Acceptance/AbstractCest.php +++ b/src/Test/Functional/Acceptance/AbstractCest.php @@ -33,14 +33,14 @@ public function _before(\CliTester $I): void $I->cloneTemplateToWorkDir(static::TEMPLATE_VERSION); $I->createAuthJson(); $I->createArtifactsDir(); - $I->createArtifactCurrentTestedCode('docker', '1.3.5'); + $I->createArtifactCurrentTestedCode('docker', '1.4.3'); $I->addArtifactsRepoToComposer(); - $I->addDependencyToComposer('magento/magento-cloud-docker', '1.3.5'); + $I->addDependencyToComposer('magento/magento-cloud-docker', '1.4.3'); $I->addEceToolsGitRepoToComposer(); $I->addDependencyToComposer( 'magento/ece-tools', - $I->getDependencyVersion('magento/ece-tools') ?: 'dev-develop as 2002.1.99' + $I->getDependencyVersion('magento/ece-tools') ?: 'dev-develop as 2002.2.99' ); if ($mccVersion = $I->getDependencyVersion('magento/magento-cloud-components')) { diff --git a/src/Test/Functional/Acceptance/Acceptance83Cest.php b/src/Test/Functional/Acceptance/Acceptance83Cest.php new file mode 100644 index 00000000..8176de43 --- /dev/null +++ b/src/Test/Functional/Acceptance/Acceptance83Cest.php @@ -0,0 +1,21 @@ +generateDockerCompose($this->buildCommand($data)); + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + + // Test Valkey connectivity (this also confirms it's running) + $I->runDockerComposeCommand('exec -T valkey valkey-cli ping'); + $I->seeInOutput('PONG'); + + // Test that Valkey container is running and healthy + $I->runDockerComposeCommand('ps'); + $I->seeInOutput('valkey'); + $I->seeInOutput('(healthy)'); + + // Test that Valkey is accessible through cache alias (using nc to test network connectivity) + $I->runDockerComposeCommand('exec -T fpm nc -z cache 6379'); + $I->seeInOutput(''); // nc returns empty output on success + + // Test that Valkey is accessible through valkey.magento2.docker alias + $I->runDockerComposeCommand('exec -T fpm nc -z valkey.magento2.docker 6379'); + $I->seeInOutput(''); + + // Test basic Valkey functionality + $I->runDockerComposeCommand('exec -T valkey valkey-cli set test_key "test_value"'); + $I->seeInOutput('OK'); + + $I->runDockerComposeCommand('exec -T valkey valkey-cli get test_key'); + $I->seeInOutput('test_value'); + + // Test Valkey info command to verify version + $I->runDockerComposeCommand('exec -T valkey valkey-cli info server'); + $I->seeInOutput('valkey_version:' . $data['version']); + + // Test confirmed: Valkey is accessible on port 6379 (validated via info command above) + + // Test memory usage reporting + $I->runDockerComposeCommand('exec -T valkey valkey-cli info memory'); + $I->seeInOutput('used_memory:'); + $I->seeInOutput('used_memory_human:'); + + // Test health check functionality + $I->runDockerComposeCommand('exec -T valkey valkey-cli ping'); + $I->seeInOutput('PONG'); + + // Test data persistence + $I->runDockerComposeCommand('exec -T valkey valkey-cli set persistent_key "persistent_value"'); + $I->seeInOutput('OK'); + + $I->runDockerComposeCommand('exec -T valkey valkey-cli get persistent_key'); + $I->seeInOutput('persistent_value'); + + // Test database operations + $I->runDockerComposeCommand('exec -T valkey valkey-cli dbsize'); + $I->seeInOutput('2'); // We should have 2 keys: test_key and persistent_key + + // Test that Valkey configuration is accessible + $I->runDockerComposeCommand('exec -T valkey valkey-cli config get save'); + $I->seeInOutput('save'); + } + + /** + * Builds build:compose command from given test data + * + * @param Example $data + * @return string + */ + private function buildCommand(Example $data): string + { + $command = sprintf( + '--mode=production --valkey=%s --no-es --no-os --no-redis', + $data['version'] + ); + + return $command; + } + + /** + * @return array + */ + protected function dataProvider(): array + { + return [ + [ + 'version' => '8.0', + ], + ]; + } +} diff --git a/src/Test/Integration/BuildComposeTest.php b/src/Test/Integration/BuildComposeTest.php index 1d07abab..e2501ac9 100644 --- a/src/Test/Integration/BuildComposeTest.php +++ b/src/Test/Integration/BuildComposeTest.php @@ -51,12 +51,12 @@ public function testBuild(string $directory, array $options): void ); /** @var MockObject|InputInterface $inputMock */ - $inputMock = $this->getMockForAbstractClass(InputInterface::class); + $inputMock = $this->createMock(InputInterface::class); $inputMock->method('getOption') ->willReturnMap($options); /** @var MockObject|OutputInterface $outputMock */ - $outputMock = $this->getMockForAbstractClass(OutputInterface::class); + $outputMock = $this->createMock(OutputInterface::class); $command->execute($inputMock, $outputMock); diff --git a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml index 74dfdd7f..1ed81d52 100644 --- a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - 'magento-magento-db:/var/lib/mysql' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml index 74a84bf7..e96c64b1 100644 --- a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - '.docker/mysql/mariadb.conf.d:/etc/mysql/mariadb.conf.d' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml index 54c717fd..b244c9eb 100644 --- a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - 'magento-app:/app' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml index e25a911e..b9b179e0 100644 --- a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - 'magento-magento-db:/var/lib/mysql' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml index d3cf9d96..d0f17348 100644 --- a/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - 'magento-magento-db:/var/lib/mysql' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml index 8b774054..50b71d7a 100644 --- a/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - 'magento-magento-db:/var/lib/mysql' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml index 93cc628a..a8f32c1b 100644 --- a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - 'mymagento-magento-db:/var/lib/mysql' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml index 79de8db1..da788c3e 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'mymagento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml index 8c3eacb0..773a33d2 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'mymagento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml index 54f88c2d..4d7bda12 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'mymagento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml index 6c22ca4f..3f38882e 100644 --- a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml index 945b3ed5..33757293 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml index 427a05e9..5c791f8b 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml index f281d22e..0a9f3b9f 100644 --- a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml index f281d22e..0a9f3b9f 100644 --- a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml index e06213a8..6549599d 100644 --- a/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml index a4075782..95a7c3d7 100644 --- a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml index 04141e68..086e6ebd 100644 --- a/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml index 0b086bc0..f91ef529 100644 --- a/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml @@ -15,7 +15,9 @@ services: - '.docker/mnt:/mnt:rw,delegated' - 'magento-magento-db:/var/lib/mysql' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml index 6fa9e929..e498a0f6 100644 --- a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml @@ -17,7 +17,9 @@ services: - 'magento-magento-db:/var/lib/mysql' - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' healthcheck: - test: 'mysqladmin ping -h localhost -pmagento2' + test: + - CMD-SHELL + - '(mariadb-admin ping -h localhost -pmagento2 || mysqladmin ping -h localhost -pmagento2)' interval: 30s timeout: 30s retries: 3 diff --git a/src/Test/Unit/Config/RelationshipTest.php b/src/Test/Unit/Config/RelationshipTest.php index e4a18f2a..7def0faf 100644 --- a/src/Test/Unit/Config/RelationshipTest.php +++ b/src/Test/Unit/Config/RelationshipTest.php @@ -46,6 +46,12 @@ class RelationshipTest extends TestCase 'port' => '6379' ] ], + 'valkey' => [ + [ + 'host' => 'cache', + 'port' => '6379' + ] + ], 'elasticsearch' => [ [ 'host' => 'elasticsearch', @@ -90,6 +96,7 @@ public function testGet() { $mysqlVersion = '10.4'; $redisVersion = '5.2'; + $valkeyVersion = '8.0'; $esVersion = '7.7'; $osVersion = '1.1'; $rmqVersion = '3.5'; @@ -97,12 +104,13 @@ public function testGet() $configWithType = $this->defaultConfigs; $configWithType['database'][0]['type'] = "mysql:$mysqlVersion"; $configWithType['redis'][0]['type'] = "redis:$redisVersion"; + $configWithType['valkey'][0]['type'] = "valkey:$valkeyVersion"; $configWithType['elasticsearch'][0]['type'] = "elasticsearch:$esVersion"; $configWithType['opensearch'][0]['type'] = "opensearch:$osVersion"; $configWithType['rabbitmq'][0]['type'] = "rabbitmq:$rmqVersion"; $configWithType['zookeeper'][0]['type'] = "zookeeper:$zookeeperVersion"; - $this->configMock->expects($this->exactly(8)) + $this->configMock->expects($this->exactly(9)) ->method('hasServiceEnabled') ->willReturnCallback(function ($service) { static $services = [ @@ -110,6 +118,7 @@ public function testGet() ServiceInterface::SERVICE_DB_QUOTE, ServiceInterface::SERVICE_DB_SALES, 'redis', + 'valkey', 'elasticsearch', 'opensearch', 'rabbitmq', @@ -124,6 +133,7 @@ public function testGet() true, true, true, + true, true ]; @@ -138,6 +148,7 @@ public function testGet() $services = [ ServiceInterface::SERVICE_DB, 'redis', + 'valkey', 'elasticsearch', 'opensearch', 'rabbitmq', @@ -147,13 +158,14 @@ public function testGet() $versions = [ $mysqlVersion, $redisVersion, + $valkeyVersion, $esVersion, $osVersion, $rmqVersion, $zookeeperVersion ]; - $this->configMock->expects($this->exactly(6)) + $this->configMock->expects($this->exactly(7)) ->method('getServiceVersion') ->willReturnCallback(function ($service) use ( &$services,