Skip to content

Commit

Permalink
Merge pull request #130 from magento-commerce/develop
Browse files Browse the repository at this point in the history
MCLOUD-12025 Cloud Tools Releas
  • Loading branch information
sivaram7 committed Apr 5, 2024
2 parents cf95bd4 + 163a02c commit c4b5035
Show file tree
Hide file tree
Showing 86 changed files with 954 additions and 91 deletions.
14 changes: 6 additions & 8 deletions .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": {
Expand All @@ -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"]
}
12 changes: 6 additions & 6 deletions composer.json
Expand Up @@ -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"
Expand All @@ -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",
Expand All @@ -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"
},
Expand Down
1 change: 1 addition & 0 deletions config/services.xml
Expand Up @@ -9,6 +9,7 @@
<prototype namespace="Magento\CloudDocker\" resource="../src/*" exclude="../src/{Test}"/>
<service id="Magento\CloudDocker\App\Container" autowire="false"/>
<service id="Magento\CloudDocker\App\ContainerInterface" alias="container"/>
<service id="Psr\Container\ContainerInterface" alias="service_container"/>
<service id="Magento\CloudDocker\App\ContainerException" autowire="false"/>
<service id="Magento\CloudDocker\Compose\BuilderFactory">
<argument key="$strategies" type="collection">
Expand Down
@@ -1,4 +1,4 @@
FROM nginx:1.19
FROM nginx:1.24

ENV UPLOAD_MAX_FILESIZE 64M
ENV XDEBUG_HOST fpm_xdebug
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions 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
12 changes: 12 additions & 0 deletions 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
12 changes: 12 additions & 0 deletions 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
21 changes: 21 additions & 0 deletions 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
12 changes: 12 additions & 0 deletions 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
12 changes: 12 additions & 0 deletions 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
2 changes: 1 addition & 1 deletion images/php/8.0-cli/Dockerfile
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion images/php/8.1-cli/Dockerfile
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion images/php/8.2-cli/Dockerfile
Expand Up @@ -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
Expand Down
193 changes: 193 additions & 0 deletions 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"]

0 comments on commit c4b5035

Please sign in to comment.