diff --git a/.github/.metadata.json b/.github/.metadata.json index 4f52d256..1c8a4040 100644 --- a/.github/.metadata.json +++ b/.github/.metadata.json @@ -1,14 +1,14 @@ { - "templateVersion": "0.1", + "templateVersion": "0.2", "product": { "name": "Magento Cloud Docker", "description": "The Magento Cloud Docker implementation deploys Cloud projects to a local workstation so that you can develop and test your code in a simulated Cloud environment" }, "contacts": { "team": { - "name": "Magic Mountain", - "DL": "Grp-magento-cloud-all", - "slackChannel": "magic_mountain" + "name": "Mystic Mountain", + "DL": "Grp-Mystic-Mountain", + "slackChannel": "#mystic-mountain-team" } }, "ticketTracker": { @@ -17,10 +17,8 @@ }, "securityJiraQueue": { "projectKey": "MAGREQ", - "component": "Magento Cloud Engineering" + "component": "MAGREQ/Magento Cloud Engineering" } }, - "staticScan": { - "enable": false - } + "productionCodeBranches": ["1.0", "1.1", "1.2", "1.3"] } diff --git a/composer.json b/composer.json index 95eeda60..fde460ba 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.3.6", + "version": "1.3.7", "license": [ "OSL-3.0", "AFL-3.0" @@ -13,10 +13,10 @@ "composer/composer": "^1.4 || ^2.0", "composer/semver": "@stable", "illuminate/config": "^5.5||^8.77", - "symfony/config": "^4.4 || ^5.1", - "symfony/console": "^2.8 || ^4.0 || ^5.1", - "symfony/dependency-injection": "^3.3 || ^4.3 || ^5.1", - "symfony/yaml": "^3.3 || ^4.0 || ^5.1" + "symfony/config": "^4.4 || ^5.1|| ^5.4 || ^6.4", + "symfony/console": "^2.8 || ^4.0 || ^5.1 || ^5.4 || ^6.4", + "symfony/dependency-injection": "^3.3 || ^4.3 || ^5.1|| ^5.4 || ^6.4", + "symfony/yaml": "^3.3 || ^4.0 || ^5.1 || ^5.4|| ^6.4" }, "require-dev": { "codeception/codeception": "^4.1", @@ -26,7 +26,7 @@ "codeception/module-rest": "^1.2", "consolidation/robo": "^1.2 || ^2.0", "phpmd/phpmd": "@stable", - "phpstan/phpstan": "^0.12", + "phpstan/phpstan": "^1.8", "phpunit/phpunit": "^8.5 || ^9.5", "squizlabs/php_codesniffer": "^3.0" }, diff --git a/config/services.xml b/config/services.xml index 3e08211f..9dc5ae85 100644 --- a/config/services.xml +++ b/config/services.xml @@ -9,6 +9,7 @@ + diff --git a/images/nginx/1.19/Dockerfile b/images/nginx/1.24/Dockerfile similarity index 98% rename from images/nginx/1.19/Dockerfile rename to images/nginx/1.24/Dockerfile index e75bac29..ca4a2585 100644 --- a/images/nginx/1.19/Dockerfile +++ b/images/nginx/1.24/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:1.19 +FROM nginx:1.24 ENV UPLOAD_MAX_FILESIZE 64M ENV XDEBUG_HOST fpm_xdebug diff --git a/images/nginx/1.19/docker-entrypoint.sh b/images/nginx/1.24/docker-entrypoint.sh similarity index 100% rename from images/nginx/1.19/docker-entrypoint.sh rename to images/nginx/1.24/docker-entrypoint.sh diff --git a/images/nginx/1.19/etc/nginx.conf b/images/nginx/1.24/etc/nginx.conf similarity index 100% rename from images/nginx/1.19/etc/nginx.conf rename to images/nginx/1.24/etc/nginx.conf diff --git a/images/nginx/1.19/etc/vhost.conf b/images/nginx/1.24/etc/vhost.conf similarity index 100% rename from images/nginx/1.19/etc/vhost.conf rename to images/nginx/1.24/etc/vhost.conf diff --git a/images/nginx/1.19/etc/xdebug-upstream.conf b/images/nginx/1.24/etc/xdebug-upstream.conf similarity index 100% rename from images/nginx/1.19/etc/xdebug-upstream.conf rename to images/nginx/1.24/etc/xdebug-upstream.conf diff --git a/images/opensearch/1.3/Dockerfile b/images/opensearch/1.3/Dockerfile new file mode 100644 index 00000000..ee27282e --- /dev/null +++ b/images/opensearch/1.3/Dockerfile @@ -0,0 +1,21 @@ +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 && \ + 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/1.3/docker-entrypoint.sh b/images/opensearch/1.3/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/1.3/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/1.3/docker-healthcheck.sh b/images/opensearch/1.3/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/1.3/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/opensearch/2.12/Dockerfile b/images/opensearch/2.12/Dockerfile new file mode 100644 index 00000000..976c19fd --- /dev/null +++ b/images/opensearch/2.12/Dockerfile @@ -0,0 +1,21 @@ +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 && \ + 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/2.12/docker-entrypoint.sh b/images/opensearch/2.12/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/2.12/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/2.12/docker-healthcheck.sh b/images/opensearch/2.12/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/2.12/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/8.0-cli/Dockerfile b/images/php/8.0-cli/Dockerfile index 45dd71d1..03ddcad2 100644 --- a/images/php/8.0-cli/Dockerfile +++ b/images/php/8.0-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.0.14-cli -ARG COMPOSER_VERSION=2.1.14 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.1-cli/Dockerfile b/images/php/8.1-cli/Dockerfile index 99010a5f..d810cd61 100644 --- a/images/php/8.1-cli/Dockerfile +++ b/images/php/8.1-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.1.1-cli -ARG COMPOSER_VERSION=2.1.14 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.2-cli/Dockerfile b/images/php/8.2-cli/Dockerfile index dbafd471..1427b2fd 100644 --- a/images/php/8.2-cli/Dockerfile +++ b/images/php/8.2-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.2-cli -ARG COMPOSER_VERSION=2.2.18 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile new file mode 100644 index 00000000..21b4957e --- /dev/null +++ b/images/php/8.3-cli/Dockerfile @@ -0,0 +1,193 @@ +# 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:8.3-cli + +ARG COMPOSER_VERSION=2.7.0 +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 \ + libgmp-dev \ + libgpgme11-dev \ + libicu-dev \ + libldap2-dev \ + libpcre3-dev \ + libpspell-dev \ + libtidy-dev \ + libxslt1-dev \ + libyaml-dev \ + libzip-dev \ + zip \ + python3-yaml \ + && rm -rf /var/lib/apt/lists/* + +# Install Python packages + + +# 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 \ + xsl \ + zip \ + pcntl + +RUN pecl install -o -f \ + gnupg \ + mailparse \ + msgpack \ + oauth \ + pcov \ + raphf \ + redis \ + xdebug-3.3.0 \ + xmlrpc-1.0.0RC3 \ + 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 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 + +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/8.3-cli/bin/cloud-build b/images/php/8.3-cli/bin/cloud-build new file mode 100644 index 00000000..bbd584c9 --- /dev/null +++ b/images/php/8.3-cli/bin/cloud-build @@ -0,0 +1,44 @@ +#!/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.3-cli/bin/cloud-deploy b/images/php/8.3-cli/bin/cloud-deploy new file mode 100644 index 00000000..f6b891bf --- /dev/null +++ b/images/php/8.3-cli/bin/cloud-deploy @@ -0,0 +1,37 @@ +#!/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.3-cli/bin/cloud-post-deploy b/images/php/8.3-cli/bin/cloud-post-deploy new file mode 100644 index 00000000..f5bb3956 --- /dev/null +++ b/images/php/8.3-cli/bin/cloud-post-deploy @@ -0,0 +1,11 @@ +#!/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.3-cli/bin/ece-command b/images/php/8.3-cli/bin/ece-command new file mode 100644 index 00000000..36d896c5 --- /dev/null +++ b/images/php/8.3-cli/bin/ece-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" + +exec $ECE_COMMAND "$@" diff --git a/images/php/8.3-cli/bin/magento-command b/images/php/8.3-cli/bin/magento-command new file mode 100644 index 00000000..8d439f7d --- /dev/null +++ b/images/php/8.3-cli/bin/magento-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" + +exec $MAGENTO_COMMAND "$@" diff --git a/images/php/8.3-cli/bin/magento-installer b/images/php/8.3-cli/bin/magento-installer new file mode 100644 index 00000000..73645ab7 --- /dev/null +++ b/images/php/8.3-cli/bin/magento-installer @@ -0,0 +1,11 @@ +#!/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.3-cli/bin/mftf-command b/images/php/8.3-cli/bin/mftf-command new file mode 100644 index 00000000..88eaa1df --- /dev/null +++ b/images/php/8.3-cli/bin/mftf-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" + +exec $MFTF_COMMAND "$@" diff --git a/images/php/8.3-cli/bin/run-cron b/images/php/8.3-cli/bin/run-cron new file mode 100644 index 00000000..f6554a5c --- /dev/null +++ b/images/php/8.3-cli/bin/run-cron @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +cron && tail -f -n0 /var/log/cron.log diff --git a/images/php/8.3-cli/bin/run-hooks b/images/php/8.3-cli/bin/run-hooks new file mode 100644 index 00000000..8ac215c9 --- /dev/null +++ b/images/php/8.3-cli/bin/run-hooks @@ -0,0 +1,61 @@ +#!/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.3-cli/docker-entrypoint.sh b/images/php/8.3-cli/docker-entrypoint.sh new file mode 100644 index 00000000..ee380b80 --- /dev/null +++ b/images/php/8.3-cli/docker-entrypoint.sh @@ -0,0 +1,35 @@ +#!/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.3-cli/etc/mail.ini b/images/php/8.3-cli/etc/mail.ini new file mode 100644 index 00000000..c1620288 --- /dev/null +++ b/images/php/8.3-cli/etc/mail.ini @@ -0,0 +1,2 @@ +; Sendmail +sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.3-cli/etc/php-cli.ini b/images/php/8.3-cli/etc/php-cli.ini new file mode 100644 index 00000000..dfaf04e4 --- /dev/null +++ b/images/php/8.3-cli/etc/php-cli.ini @@ -0,0 +1,10 @@ +; 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.3-cli/etc/php-gnupg.ini b/images/php/8.3-cli/etc/php-gnupg.ini new file mode 100644 index 00000000..f0f7e9a7 --- /dev/null +++ b/images/php/8.3-cli/etc/php-gnupg.ini @@ -0,0 +1 @@ +extension = gnupg.so diff --git a/images/php/8.3-cli/etc/php-pcov.ini b/images/php/8.3-cli/etc/php-pcov.ini new file mode 100644 index 00000000..a9f0145a --- /dev/null +++ b/images/php/8.3-cli/etc/php-pcov.ini @@ -0,0 +1,2 @@ +pcov.enabled = 1 +pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.3-cli/etc/php-xdebug.ini b/images/php/8.3-cli/etc/php-xdebug.ini new file mode 100644 index 00000000..57b1bd9f --- /dev/null +++ b/images/php/8.3-cli/etc/php-xdebug.ini @@ -0,0 +1,8 @@ +; 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.3-fpm/Dockerfile b/images/php/8.3-fpm/Dockerfile new file mode 100644 index 00000000..039114c4 --- /dev/null +++ b/images/php/8.3-fpm/Dockerfile @@ -0,0 +1,151 @@ +# 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:8.3-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 \ + libgmp-dev \ + libgpgme11-dev \ + libicu-dev \ + libldap2-dev \ + libpcre3-dev \ + libpspell-dev \ + libtidy-dev \ + libxslt1-dev \ + libyaml-dev \ + libzip-dev \ + zip \ + python3-yaml \ + && 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 \ + xsl \ + zip \ + pcntl + +RUN pecl install -o -f \ + gnupg \ + mailparse \ + msgpack \ + oauth \ + pcov \ + raphf \ + redis \ + xdebug-3.3.0 \ + xmlrpc-1.0.0RC3 \ + 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 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 + +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.3-fpm/docker-entrypoint.sh b/images/php/8.3-fpm/docker-entrypoint.sh new file mode 100644 index 00000000..0c8c5c9c --- /dev/null +++ b/images/php/8.3-fpm/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/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.3-fpm/etc/mail.ini b/images/php/8.3-fpm/etc/mail.ini new file mode 100644 index 00000000..c1620288 --- /dev/null +++ b/images/php/8.3-fpm/etc/mail.ini @@ -0,0 +1,2 @@ +; Sendmail +sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.3-fpm/etc/php-fpm.conf b/images/php/8.3-fpm/etc/php-fpm.conf new file mode 100644 index 00000000..d988b314 --- /dev/null +++ b/images/php/8.3-fpm/etc/php-fpm.conf @@ -0,0 +1,25 @@ +[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.3-fpm/etc/php-fpm.ini b/images/php/8.3-fpm/etc/php-fpm.ini new file mode 100644 index 00000000..387c8aeb --- /dev/null +++ b/images/php/8.3-fpm/etc/php-fpm.ini @@ -0,0 +1,4 @@ +memory_limit = ${PHP_MEMORY_LIMIT} +opcache.enable = 1 +opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} +user_ini.filename = diff --git a/images/php/8.3-fpm/etc/php-gnupg.ini b/images/php/8.3-fpm/etc/php-gnupg.ini new file mode 100644 index 00000000..f0f7e9a7 --- /dev/null +++ b/images/php/8.3-fpm/etc/php-gnupg.ini @@ -0,0 +1 @@ +extension = gnupg.so diff --git a/images/php/8.3-fpm/etc/php-pcov.ini b/images/php/8.3-fpm/etc/php-pcov.ini new file mode 100644 index 00000000..a9f0145a --- /dev/null +++ b/images/php/8.3-fpm/etc/php-pcov.ini @@ -0,0 +1,2 @@ +pcov.enabled = 1 +pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.3-fpm/etc/php-xdebug.ini b/images/php/8.3-fpm/etc/php-xdebug.ini new file mode 100644 index 00000000..57b1bd9f --- /dev/null +++ b/images/php/8.3-fpm/etc/php-xdebug.ini @@ -0,0 +1,8 @@ +; 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/src/Application.php b/src/Application.php index 2aca8022..a6403b9e 100644 --- a/src/Application.php +++ b/src/Application.php @@ -35,7 +35,7 @@ public function __construct(ContainerInterface $container) /** * @inheritdoc */ - protected function getDefaultCommands() + protected function getDefaultCommands(): array { return array_merge(parent::getDefaultCommands(), [ $this->container->get(Command\BuildCompose::class), diff --git a/src/Command/Image/GenerateOs.php b/src/Command/Image/GenerateOs.php index 2b71aabe..623c05b1 100644 --- a/src/Command/Image/GenerateOs.php +++ b/src/Command/Image/GenerateOs.php @@ -34,6 +34,9 @@ class GenerateOs extends Command '1.2' => [ 'real-version' => '1.2.1', ], + '1.3' => [ + 'real-version' => '1.3.0', + ], '2.3' => [ 'real-version' => '2.3.0' ], @@ -42,6 +45,9 @@ class GenerateOs extends Command ], '2.5' => [ 'real-version' => '2.5.0' + ], + '2.12' => [ + 'real-version' => '2.12.0' ] ]; diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index 238b3052..044a5ba0 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -26,7 +26,7 @@ class GeneratePhp extends Command { private const NAME = 'image:generate:php'; - private const SUPPORTED_VERSIONS = ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']; + private const SUPPORTED_VERSIONS = ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']; private const VERSION_MAP = [ '7.2' => '7.2', @@ -34,7 +34,8 @@ class GeneratePhp extends Command '7.4' => '7.4', '8.0' => '8.0.14', '8.1' => '8.1.1', - '8.2' => '8.2' + '8.2' => '8.2', + '8.3' => '8.3' ]; private const EDITION_CLI = 'cli'; @@ -286,7 +287,7 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string } } - if ($this->semver::satisfies($phpVersion, '8.2.*')) { + if ($this->semver::satisfies($phpVersion, '>=8.2')) { $packages[] = 'python3-yaml'; $pythonPackages = ''; } else { diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 46b95dde..97db7a5b 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -427,10 +427,14 @@ public static function getConfig(): array self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, self::EXTENSION_PACKAGE_NAME => 'xdebug-3.1.2', ], - '>=8.2' => [ + '>=8.2 <8.3' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, self::EXTENSION_PACKAGE_NAME => 'xdebug-3.2.0', ], + '>=8.3' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, + self::EXTENSION_PACKAGE_NAME => 'xdebug-3.3.0', + ], ], 'xmlrpc' => [ '>=7.0 <8.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], diff --git a/src/Compose/ProductionBuilder/Service/ElasticSearch.php b/src/Compose/ProductionBuilder/Service/ElasticSearch.php index bd450b54..6c1af0d5 100644 --- a/src/Compose/ProductionBuilder/Service/ElasticSearch.php +++ b/src/Compose/ProductionBuilder/Service/ElasticSearch.php @@ -73,7 +73,7 @@ public function getConfig(Config $config): array return $this->serviceFactory->create( $this->getServiceName(), $config->getServiceVersion($this->getServiceName()), - !empty($esEnvVars) ? ['environment' => $esEnvVars] : [], + ['environment' => $esEnvVars], $config->getServiceImage($this->getServiceName()), $config->getCustomRegistry(), $config->getServiceImagePattern($this->getServiceName()) diff --git a/src/Compose/ProductionBuilder/Service/OpenSearch.php b/src/Compose/ProductionBuilder/Service/OpenSearch.php index 32519de2..460d532f 100644 --- a/src/Compose/ProductionBuilder/Service/OpenSearch.php +++ b/src/Compose/ProductionBuilder/Service/OpenSearch.php @@ -84,7 +84,7 @@ public function getConfig(Config $config): array return $this->serviceFactory->create( $this->getServiceName(), $this->getVersion($config), - !empty($osEnvVars) ? ['environment' => $osEnvVars] : [], + ['environment' => $osEnvVars], $config->getServiceImage($this->getServiceName()), $config->getCustomRegistry(), $config->getServiceImagePattern($this->getServiceName()) diff --git a/src/Service/ServiceFactory.php b/src/Service/ServiceFactory.php index b04286fb..c52206a5 100644 --- a/src/Service/ServiceFactory.php +++ b/src/Service/ServiceFactory.php @@ -42,7 +42,7 @@ class ServiceFactory */ private const SERVICE_NGINX_CONFIG = [ 'image' => 'magento/magento-cloud-docker-nginx', - 'version' => '1.19', + 'version' => '1.24', 'pattern' => self::PATTERN_VERSIONED, 'config' => [ 'extends' => ServiceInterface::SERVICE_GENERIC, diff --git a/src/Test/Functional/Acceptance/Acceptance82Cest.php b/src/Test/Functional/Acceptance/Acceptance82Cest.php new file mode 100644 index 00000000..b0ac70ff --- /dev/null +++ b/src/Test/Functional/Acceptance/Acceptance82Cest.php @@ -0,0 +1,21 @@ + [ 'redis:5.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2' @@ -40,7 +40,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:3.2', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.4-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.1', @@ -53,7 +53,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:4.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', @@ -66,7 +66,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:5.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', diff --git a/src/Test/Functional/Acceptance/ServicesCest.php b/src/Test/Functional/Acceptance/ServicesCest.php index 52916362..669cf39d 100644 --- a/src/Test/Functional/Acceptance/ServicesCest.php +++ b/src/Test/Functional/Acceptance/ServicesCest.php @@ -92,7 +92,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:5.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.3-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2' @@ -104,7 +104,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:3.2', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.1', @@ -117,7 +117,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:4.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.4-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', @@ -130,7 +130,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:5.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.3-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', diff --git a/src/Test/Integration/BuildCustomComposeTest.php b/src/Test/Integration/BuildCustomComposeTest.php index 32a5d2b4..de1600c7 100644 --- a/src/Test/Integration/BuildCustomComposeTest.php +++ b/src/Test/Integration/BuildCustomComposeTest.php @@ -248,7 +248,7 @@ public function buildDataProvider(): array ], 'nginx' => [ 'image' => 'nginx-v1', - 'version' => '1.19', + 'version' => '1.24', 'image-pattern' => '%s:%s', 'enabled' => 'true', ], 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 e054a41c..b30d706b 100644 --- a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml @@ -103,7 +103,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -137,7 +137,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 e56337e6..9efb15b4 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 @@ -96,7 +96,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:delegated' @@ -123,7 +123,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 d8c7d928..974390b4 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 @@ -76,7 +76,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - 'magento-app:/app' @@ -103,7 +103,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 6e8bab5e..f42e86ff 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 @@ -72,7 +72,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - './magento2ce:/app:ro,delegated' @@ -107,7 +107,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 e5ec19e0..7487f54f 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 @@ -103,7 +103,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -137,7 +137,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 c385367a..044e3738 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 @@ -103,7 +103,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -137,7 +137,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 0585618f..ca55c534 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 @@ -72,7 +72,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -107,7 +107,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 53d8630b..ee750e4a 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 @@ -82,7 +82,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -116,7 +116,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 428d8228..e0a50c5a 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 @@ -82,7 +82,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -116,7 +116,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 a38f457a..ec1bd183 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 @@ -82,7 +82,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -116,7 +116,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 e29152a7..72b7c93f 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 @@ -83,7 +83,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' 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 fe34a339..cfb3e7da 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 @@ -83,7 +83,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' 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 519258d7..819e0e80 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 @@ -83,7 +83,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -107,7 +107,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 2b9e82d2..bab4b358 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 @@ -46,7 +46,7 @@ services: condition: service_healthy web: hostname: web.magento2.test - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -80,7 +80,7 @@ services: condition: service_started tls: hostname: tls.magento2.test - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 2b9e82d2..bab4b358 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 @@ -46,7 +46,7 @@ services: condition: service_healthy web: hostname: web.magento2.test - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -80,7 +80,7 @@ services: condition: service_started tls: hostname: tls.magento2.test - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 5bd8a9e7..e06213a8 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 @@ -84,7 +84,7 @@ services: condition: service_healthy web: hostname: web.magento2.test - image: 'nginx-v1:1.19' + image: 'nginx-v1:1.24' extends: generic volumes: - '.:/app:ro,delegated' @@ -119,7 +119,7 @@ services: condition: service_started tls: hostname: tls.magento2.test - image: 'nginx-v1:1.19' + image: 'nginx-v1:1.24' extends: generic networks: magento: 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 f2b4ae19..33166249 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 @@ -41,7 +41,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' 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 026a62e1..876f2b95 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 @@ -41,7 +41,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' 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 0de6c3ab..152351e0 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 @@ -41,7 +41,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -61,7 +61,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: 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 74f1e281..d7bf7488 100644 --- a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml @@ -85,7 +85,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: '123.example.com/magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: '123.example.com/magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -119,7 +119,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: '123.example.com/magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: '123.example.com/magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/tests/functional/Codeception/Docker.php b/tests/functional/Codeception/Docker.php index 9ed7a70a..ac65e51d 100644 --- a/tests/functional/Codeception/Docker.php +++ b/tests/functional/Codeception/Docker.php @@ -23,7 +23,7 @@ class Docker extends BaseModule /** * @var array */ - protected $config = [ + protected array $config = [ 'system_magento_dir' => '', 'printOutput' => false, ]; @@ -31,12 +31,12 @@ class Docker extends BaseModule /** * @var array */ - protected $services = []; + protected array $services = []; /** * @inheritdoc */ - public function _initialize() + public function _initialize(): void { $container = Robo::createDefaultContainer(); $builder = CollectionBuilder::create($container, $this); diff --git a/tests/functional/Codeception/MagentoDb.php b/tests/functional/Codeception/MagentoDb.php index be5d5d6b..c8dd9d6c 100644 --- a/tests/functional/Codeception/MagentoDb.php +++ b/tests/functional/Codeception/MagentoDb.php @@ -113,7 +113,7 @@ public function _beforeStep(Step $step) /** * @inheritdoc */ - public function _after(TestInterface $test) + public function _after(TestInterface $test): void { $this->disconnectDatabases(); } @@ -122,17 +122,17 @@ public function _after(TestInterface $test) * This method is overridden to avoid connection attempts before running Docker * {@inheritdoc} */ - public function _initialize() {} + public function _initialize(): void {} /** * This method is overridden to avoid connection attempts before running Docker * {@inheritdoc} */ - public function _beforeSuite($settings = []) {} + public function _beforeSuite($settings = []): void {} /** * This method is overridden to avoid connection attempts before running Docker * {@inheritdoc} */ - public function _before(TestInterface $test) {} + public function _before(TestInterface $test): void {} } diff --git a/tests/functional/Robo/Tasks/CopyFromDocker.php b/tests/functional/Robo/Tasks/CopyFromDocker.php index 2dd862d4..1a071542 100644 --- a/tests/functional/Robo/Tasks/CopyFromDocker.php +++ b/tests/functional/Robo/Tasks/CopyFromDocker.php @@ -80,7 +80,7 @@ public function destination(string $destination): self public function getCommand(): string { return sprintf( - 'docker cp "$(docker-compose ps -q %s)":%s %s', + 'docker-compose cp %s:%s %s', $this->container, $this->source, $this->destination diff --git a/tests/functional/Robo/Tasks/CopyToDocker.php b/tests/functional/Robo/Tasks/CopyToDocker.php index 5e3cf0c3..22cecf6e 100644 --- a/tests/functional/Robo/Tasks/CopyToDocker.php +++ b/tests/functional/Robo/Tasks/CopyToDocker.php @@ -80,7 +80,7 @@ public function destination(string $destination): self public function getCommand(): string { return sprintf( - 'docker cp %s "$(docker-compose ps -q %s)":%s', + 'docker-compose cp %s %s:%s', $this->source, $this->container, $this->destination diff --git a/tests/static/phpstan.neon b/tests/static/phpstan.neon index ea86c28c..6d5cf820 100644 --- a/tests/static/phpstan.neon +++ b/tests/static/phpstan.neon @@ -2,7 +2,7 @@ parameters: level: 5 paths: - ../../src - excludes_analyse: + excludePaths: - ../../src/Test/* reportUnmatchedIgnoredErrors: false ignoreErrors: