├── .travis.yml ├── 5.5 ├── apache │ ├── Dockerfile │ ├── entrypoint.sh │ ├── magento.conf │ └── php.ini ├── cli │ ├── Dockerfile │ ├── bin │ │ ├── magedbm │ │ ├── magemm │ │ └── magerun │ ├── entrypoint.sh │ ├── php.ini │ └── run-cron.sh └── fpm │ ├── Dockerfile │ ├── entrypoint.sh │ └── php.ini ├── 5.6 ├── apache │ ├── Dockerfile │ ├── entrypoint.sh │ ├── magento.conf │ └── php.ini ├── cli │ ├── Dockerfile │ ├── bin │ │ ├── magedbm │ │ ├── magemm │ │ └── magerun │ ├── entrypoint.sh │ ├── php.ini │ └── run-cron.sh └── fpm │ ├── Dockerfile │ ├── entrypoint.sh │ └── php.ini ├── 7.0 ├── apache │ ├── Dockerfile │ ├── entrypoint.sh │ ├── magento.conf │ └── php.ini ├── cli │ ├── Dockerfile │ ├── bin │ │ ├── magedbm │ │ ├── magemm │ │ └── magerun │ ├── entrypoint.sh │ ├── php.ini │ └── run-cron.sh └── fpm │ ├── Dockerfile │ ├── entrypoint.sh │ └── php.ini ├── 7.1 ├── apache │ ├── Dockerfile │ ├── entrypoint.sh │ ├── magento.conf │ └── php.ini ├── cli │ ├── Dockerfile │ ├── bin │ │ ├── magedbm │ │ ├── magemm │ │ └── magerun │ ├── entrypoint.sh │ ├── php.ini │ └── run-cron.sh └── fpm │ ├── Dockerfile │ ├── entrypoint.sh │ └── php.ini ├── 7.2 ├── apache │ ├── Dockerfile │ ├── entrypoint.sh │ ├── magento.conf │ └── php.ini ├── cli │ ├── Dockerfile │ ├── bin │ │ ├── magedbm │ │ ├── magemm │ │ └── magerun │ ├── entrypoint.sh │ ├── php.ini │ └── run-cron.sh └── fpm │ ├── Dockerfile │ ├── entrypoint.sh │ └── php.ini ├── 7.3 ├── apache │ ├── Dockerfile │ ├── entrypoint.sh │ ├── magento.conf │ └── php.ini ├── cli │ ├── Dockerfile │ ├── bin │ │ ├── magedbm │ │ ├── magemm │ │ └── magerun │ ├── entrypoint.sh │ ├── php.ini │ └── run-cron.sh └── fpm │ ├── Dockerfile │ ├── entrypoint.sh │ └── php.ini ├── 7.4 ├── apache │ ├── Dockerfile │ ├── entrypoint.sh │ ├── magento.conf │ └── php.ini ├── cli │ ├── Dockerfile │ ├── bin │ │ ├── magedbm │ │ ├── magemm │ │ └── magerun │ ├── entrypoint.sh │ ├── php.ini │ └── run-cron.sh └── fpm │ ├── Dockerfile │ ├── entrypoint.sh │ └── php.ini ├── LICENSE.md ├── README.md ├── builder.php ├── config.json ├── docker-compose.yml ├── src ├── Dockerfile ├── Dockerfile-apache ├── Dockerfile-cli ├── Dockerfile-fpm ├── bin │ ├── magedbm │ ├── magemm │ └── magerun ├── entrypoint.sh ├── magento.conf ├── php.ini └── run-cron.sh ├── test-runner.sh └── test └── test.php /.travis.yml: -------------------------------------------------------------------------------- 1 | services: 2 | - docker 3 | 4 | env: 5 | global: 6 | - DOCKER_IP=localhost 7 | matrix: 8 | - PHP_VERSION=5.5 IMAGE_FLAVOUR=apache 9 | - PHP_VERSION=5.6 IMAGE_FLAVOUR=apache 10 | - PHP_VERSION=7.0 IMAGE_FLAVOUR=apache 11 | - PHP_VERSION=7.1 IMAGE_FLAVOUR=apache 12 | - PHP_VERSION=7.2 IMAGE_FLAVOUR=apache 13 | - PHP_VERSION=7.3 IMAGE_FLAVOUR=apache 14 | - PHP_VERSION=7.4 IMAGE_FLAVOUR=apache 15 | - PHP_VERSION=5.5 IMAGE_FLAVOUR=cli 16 | - PHP_VERSION=5.6 IMAGE_FLAVOUR=cli 17 | - PHP_VERSION=7.0 IMAGE_FLAVOUR=cli 18 | - PHP_VERSION=7.1 IMAGE_FLAVOUR=cli 19 | - PHP_VERSION=7.2 IMAGE_FLAVOUR=cli 20 | - PHP_VERSION=7.3 IMAGE_FLAVOUR=cli 21 | - PHP_VERSION=7.4 IMAGE_FLAVOUR=cli 22 | - PHP_VERSION=5.5 IMAGE_FLAVOUR=fpm 23 | - PHP_VERSION=5.6 IMAGE_FLAVOUR=fpm 24 | - PHP_VERSION=7.0 IMAGE_FLAVOUR=fpm 25 | - PHP_VERSION=7.1 IMAGE_FLAVOUR=fpm 26 | - PHP_VERSION=7.2 IMAGE_FLAVOUR=fpm 27 | - PHP_VERSION=7.3 IMAGE_FLAVOUR=fpm 28 | - PHP_VERSION=7.4 IMAGE_FLAVOUR=fpm 29 | 30 | jobs: 31 | allow_failures: 32 | - env: PHP_VERSION=7.4 IMAGE_FLAVOUR=apache 33 | - env: PHP_VERSION=7.4 IMAGE_FLAVOUR=cli 34 | - env: PHP_VERSION=7.4 IMAGE_FLAVOUR=fpm 35 | 36 | script: 37 | - travis_wait 20 bash test-runner.sh 38 | -------------------------------------------------------------------------------- /5.5/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:5.5-apache 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "4.0.11" 5 | ENV PHP_EXT_MEMCACHED_VERSION "2.2.0" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.5.5" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libmcrypt-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && docker-php-ext-install mcrypt \ 16 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 17 | && docker-php-ext-install pcntl \ 18 | && docker-php-ext-install pdo_mysql \ 19 | && docker-php-ext-install soap \ 20 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 21 | && docker-php-ext-install xsl \ 22 | && docker-php-ext-install zip \ 23 | && docker-php-ext-install intl \ 24 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 25 | 26 | ENV ION_CUBE_PHP_VERSION "5.5" 27 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 28 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 29 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 30 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 31 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 32 | 33 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 34 | 35 | ADD entrypoint.sh /entrypoint.sh 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | 38 | RUN a2enmod rewrite headers 39 | 40 | COPY magento.conf /etc/apache2/conf-enabled/ 41 | 42 | CMD ["apache2-foreground"] 43 | -------------------------------------------------------------------------------- /5.5/apache/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /5.5/apache/magento.conf: -------------------------------------------------------------------------------- 1 | # Enable support for SSL termination 2 | SetEnvIf X-Forwarded-Proto https HTTPS=on 3 | -------------------------------------------------------------------------------- /5.5/apache/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /5.5/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:5.5-cli 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "4.0.11" 5 | ENV PHP_EXT_MEMCACHED_VERSION "2.2.0" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.5.5" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libmcrypt-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && docker-php-ext-install mcrypt \ 16 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 17 | && docker-php-ext-install pcntl \ 18 | && docker-php-ext-install pdo_mysql \ 19 | && docker-php-ext-install soap \ 20 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 21 | && docker-php-ext-install xsl \ 22 | && docker-php-ext-install zip \ 23 | && docker-php-ext-install intl \ 24 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 25 | 26 | ENV ION_CUBE_PHP_VERSION "5.5" 27 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 28 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 29 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 30 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 31 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 32 | 33 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 34 | 35 | ADD entrypoint.sh /entrypoint.sh 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | 38 | ENV BIN_DIR "/usr/local/bin" 39 | RUN apt-get update \ 40 | && apt-get install -y cron git groff mysql-client python-pip rsyslog sudo \ 41 | && sed -i '/imklog/s/^/#/' /etc/rsyslog.conf \ 42 | && pip install awscli \ 43 | && curl --retry 10 --retry-delay 3 https://getcomposer.org/installer | php -- --install-dir=$BIN_DIR --filename=composer \ 44 | && curl --retry 10 --retry-delay 3 -L https://github.com/punkstar/mageconfigsync/releases/download/0.4.0/mageconfigsync-0.4.0.phar -o $BIN_DIR/mageconfigsync && chmod +x $BIN_DIR/mageconfigsync \ 45 | && curl --retry 10 --retry-delay 3 -L https://github.com/meanbee/magedbm/releases/download/v1.6.0/magedbm.phar -o $BIN_DIR/magedbm.phar && chmod +x $BIN_DIR/magedbm.phar \ 46 | && curl --retry 10 --retry-delay 3 https://files.magerun.net/n98-magerun.phar -o $BIN_DIR/n98-magerun.phar && chmod +x $BIN_DIR/n98-magerun.phar \ 47 | && curl --retry 10 --retry-delay 3 https://raw.githubusercontent.com/colinmollenhour/modman/master/modman -o $BIN_DIR/modman && chmod +x $BIN_DIR/modman \ 48 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 49 | 50 | COPY bin/* $BIN_DIR/ 51 | ADD run-cron.sh /run-cron.sh 52 | 53 | CMD ["php", "-a"] 54 | -------------------------------------------------------------------------------- /5.5/cli/bin/magedbm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | magedbm.phar configure \ 4 | --key="$AWS_ACCESS_KEY_ID" \ 5 | --secret="$AWS_SECRET_ACCESS_KEY" \ 6 | --region="$AWS_REGION" \ 7 | --bucket="$AWS_BUCKET" 8 | 9 | exec magedbm.phar "$@" 10 | -------------------------------------------------------------------------------- /5.5/cli/bin/magemm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # magemm - sync media images from S3 4 | # 5 | 6 | set -e # Exit on error 7 | 8 | # Parameters 9 | ############################# 10 | 11 | project=$1 12 | destination=$(pwd)/media/ 13 | 14 | # Usage 15 | ############################# 16 | 17 | [ "$project" = "-h" -o "$project" = "--help" ] \ 18 | && cat << USAGE && exit 0 19 | Usage: $0 project-name 20 | 21 | Sync the media images from S3 into $destination 22 | USAGE 23 | 24 | # Validation 25 | ############################# 26 | 27 | [ -z "$project" ] \ 28 | && echo "project-name parameter required!" \ 29 | && exit 1 30 | 31 | [ -z "$AWS_ACCESS_KEY_ID" -o -z "$AWS_SECRET_ACCESS_KEY" -o -z "$AWS_REGION" -o -z "$AWS_MEDIA_BUCKET" ] \ 32 | && echo '$AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY, $AWS_REGION and $AWS_MEDIA_BUCKET environment variables required!' \ 33 | && exit 1 34 | 35 | # Main 36 | ############################# 37 | 38 | aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID 39 | aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY 40 | aws configure set default.region $AWS_REGION 41 | 42 | exec aws s3 sync --delete s3://$AWS_MEDIA_BUCKET/$project/media/ $destination 43 | -------------------------------------------------------------------------------- /5.5/cli/bin/magerun: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exec sudo -u www-data -- n98-magerun.phar "$@" 4 | -------------------------------------------------------------------------------- /5.5/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | CRON_LOG=/var/log/cron.log 6 | 7 | # Setup Magento cron 8 | echo "* * * * * root su www-data -s /bin/bash -c 'sh $(pwd)/cron.sh'" > /etc/cron.d/magento 9 | 10 | # Get rsyslog running for cron output 11 | touch $CRON_LOG 12 | echo "cron.* $CRON_LOG" > /etc/rsyslog.d/cron.conf 13 | service rsyslog start 14 | 15 | # Configure Sendmail if required 16 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 17 | /etc/init.d/sendmail start 18 | fi 19 | 20 | # Configure Xdebug 21 | if [ "$XDEBUG_CONFIG" ]; then 22 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 23 | for config in $XDEBUG_CONFIG; do 24 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 25 | done 26 | fi 27 | 28 | # Execute the supplied command 29 | exec "$@" 30 | -------------------------------------------------------------------------------- /5.5/cli/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /5.5/cli/run-cron.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && \ 4 | tail -f -n0 /var/log/cron.log 5 | -------------------------------------------------------------------------------- /5.5/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:5.5-fpm 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "4.0.11" 5 | ENV PHP_EXT_MEMCACHED_VERSION "2.2.0" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.5.5" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libmcrypt-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && docker-php-ext-install mcrypt \ 16 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 17 | && docker-php-ext-install pcntl \ 18 | && docker-php-ext-install pdo_mysql \ 19 | && docker-php-ext-install soap \ 20 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 21 | && docker-php-ext-install xsl \ 22 | && docker-php-ext-install zip \ 23 | && docker-php-ext-install intl \ 24 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 25 | 26 | ENV ION_CUBE_PHP_VERSION "5.5" 27 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 28 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 29 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 30 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 31 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 32 | 33 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 34 | 35 | ADD entrypoint.sh /entrypoint.sh 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | 38 | CMD ["php-fpm"] 39 | -------------------------------------------------------------------------------- /5.5/fpm/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /5.5/fpm/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /5.6/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:5.6-apache 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "4.0.11" 5 | ENV PHP_EXT_MEMCACHED_VERSION "2.2.0" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.5.5" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libmcrypt-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && docker-php-ext-install mcrypt \ 16 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 17 | && docker-php-ext-install pcntl \ 18 | && docker-php-ext-install pdo_mysql \ 19 | && docker-php-ext-install soap \ 20 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 21 | && docker-php-ext-install xsl \ 22 | && docker-php-ext-install zip \ 23 | && docker-php-ext-install intl \ 24 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 25 | 26 | ENV ION_CUBE_PHP_VERSION "5.6" 27 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 28 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 29 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 30 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 31 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 32 | 33 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 34 | 35 | ADD entrypoint.sh /entrypoint.sh 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | 38 | RUN a2enmod rewrite headers 39 | 40 | COPY magento.conf /etc/apache2/conf-enabled/ 41 | 42 | CMD ["apache2-foreground"] 43 | -------------------------------------------------------------------------------- /5.6/apache/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /5.6/apache/magento.conf: -------------------------------------------------------------------------------- 1 | # Enable support for SSL termination 2 | SetEnvIf X-Forwarded-Proto https HTTPS=on 3 | -------------------------------------------------------------------------------- /5.6/apache/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /5.6/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:5.6-cli 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "4.0.11" 5 | ENV PHP_EXT_MEMCACHED_VERSION "2.2.0" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.5.5" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libmcrypt-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && docker-php-ext-install mcrypt \ 16 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 17 | && docker-php-ext-install pcntl \ 18 | && docker-php-ext-install pdo_mysql \ 19 | && docker-php-ext-install soap \ 20 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 21 | && docker-php-ext-install xsl \ 22 | && docker-php-ext-install zip \ 23 | && docker-php-ext-install intl \ 24 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 25 | 26 | ENV ION_CUBE_PHP_VERSION "5.6" 27 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 28 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 29 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 30 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 31 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 32 | 33 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 34 | 35 | ADD entrypoint.sh /entrypoint.sh 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | 38 | ENV BIN_DIR "/usr/local/bin" 39 | RUN apt-get update \ 40 | && apt-get install -y cron git groff mysql-client python-pip rsyslog sudo \ 41 | && sed -i '/imklog/s/^/#/' /etc/rsyslog.conf \ 42 | && pip install awscli \ 43 | && curl --retry 10 --retry-delay 3 https://getcomposer.org/installer | php -- --install-dir=$BIN_DIR --filename=composer \ 44 | && curl --retry 10 --retry-delay 3 -L https://github.com/punkstar/mageconfigsync/releases/download/0.4.0/mageconfigsync-0.4.0.phar -o $BIN_DIR/mageconfigsync && chmod +x $BIN_DIR/mageconfigsync \ 45 | && curl --retry 10 --retry-delay 3 -L https://github.com/meanbee/magedbm/releases/download/v1.6.0/magedbm.phar -o $BIN_DIR/magedbm.phar && chmod +x $BIN_DIR/magedbm.phar \ 46 | && curl --retry 10 --retry-delay 3 https://files.magerun.net/n98-magerun.phar -o $BIN_DIR/n98-magerun.phar && chmod +x $BIN_DIR/n98-magerun.phar \ 47 | && curl --retry 10 --retry-delay 3 https://raw.githubusercontent.com/colinmollenhour/modman/master/modman -o $BIN_DIR/modman && chmod +x $BIN_DIR/modman \ 48 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 49 | 50 | COPY bin/* $BIN_DIR/ 51 | ADD run-cron.sh /run-cron.sh 52 | 53 | CMD ["php", "-a"] 54 | -------------------------------------------------------------------------------- /5.6/cli/bin/magedbm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | magedbm.phar configure \ 4 | --key="$AWS_ACCESS_KEY_ID" \ 5 | --secret="$AWS_SECRET_ACCESS_KEY" \ 6 | --region="$AWS_REGION" \ 7 | --bucket="$AWS_BUCKET" 8 | 9 | exec magedbm.phar "$@" 10 | -------------------------------------------------------------------------------- /5.6/cli/bin/magemm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # magemm - sync media images from S3 4 | # 5 | 6 | set -e # Exit on error 7 | 8 | # Parameters 9 | ############################# 10 | 11 | project=$1 12 | destination=$(pwd)/media/ 13 | 14 | # Usage 15 | ############################# 16 | 17 | [ "$project" = "-h" -o "$project" = "--help" ] \ 18 | && cat << USAGE && exit 0 19 | Usage: $0 project-name 20 | 21 | Sync the media images from S3 into $destination 22 | USAGE 23 | 24 | # Validation 25 | ############################# 26 | 27 | [ -z "$project" ] \ 28 | && echo "project-name parameter required!" \ 29 | && exit 1 30 | 31 | [ -z "$AWS_ACCESS_KEY_ID" -o -z "$AWS_SECRET_ACCESS_KEY" -o -z "$AWS_REGION" -o -z "$AWS_MEDIA_BUCKET" ] \ 32 | && echo '$AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY, $AWS_REGION and $AWS_MEDIA_BUCKET environment variables required!' \ 33 | && exit 1 34 | 35 | # Main 36 | ############################# 37 | 38 | aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID 39 | aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY 40 | aws configure set default.region $AWS_REGION 41 | 42 | exec aws s3 sync --delete s3://$AWS_MEDIA_BUCKET/$project/media/ $destination 43 | -------------------------------------------------------------------------------- /5.6/cli/bin/magerun: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exec sudo -u www-data -- n98-magerun.phar "$@" 4 | -------------------------------------------------------------------------------- /5.6/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | CRON_LOG=/var/log/cron.log 6 | 7 | # Setup Magento cron 8 | echo "* * * * * root su www-data -s /bin/bash -c 'sh $(pwd)/cron.sh'" > /etc/cron.d/magento 9 | 10 | # Get rsyslog running for cron output 11 | touch $CRON_LOG 12 | echo "cron.* $CRON_LOG" > /etc/rsyslog.d/cron.conf 13 | service rsyslog start 14 | 15 | # Configure Sendmail if required 16 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 17 | /etc/init.d/sendmail start 18 | fi 19 | 20 | # Configure Xdebug 21 | if [ "$XDEBUG_CONFIG" ]; then 22 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 23 | for config in $XDEBUG_CONFIG; do 24 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 25 | done 26 | fi 27 | 28 | # Execute the supplied command 29 | exec "$@" 30 | -------------------------------------------------------------------------------- /5.6/cli/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /5.6/cli/run-cron.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && \ 4 | tail -f -n0 /var/log/cron.log 5 | -------------------------------------------------------------------------------- /5.6/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:5.6-fpm 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "4.0.11" 5 | ENV PHP_EXT_MEMCACHED_VERSION "2.2.0" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.5.5" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libmcrypt-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && docker-php-ext-install mcrypt \ 16 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 17 | && docker-php-ext-install pcntl \ 18 | && docker-php-ext-install pdo_mysql \ 19 | && docker-php-ext-install soap \ 20 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 21 | && docker-php-ext-install xsl \ 22 | && docker-php-ext-install zip \ 23 | && docker-php-ext-install intl \ 24 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 25 | 26 | ENV ION_CUBE_PHP_VERSION "5.6" 27 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 28 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 29 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 30 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 31 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 32 | 33 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 34 | 35 | ADD entrypoint.sh /entrypoint.sh 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | 38 | CMD ["php-fpm"] 39 | -------------------------------------------------------------------------------- /5.6/fpm/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /5.6/fpm/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.0/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.0-apache 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.7" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.0.3" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.6.1" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libmcrypt-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && docker-php-ext-install mcrypt \ 16 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 17 | && docker-php-ext-install pcntl \ 18 | && docker-php-ext-install pdo_mysql \ 19 | && docker-php-ext-install soap \ 20 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 21 | && docker-php-ext-install xsl \ 22 | && docker-php-ext-install zip \ 23 | && docker-php-ext-install intl \ 24 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 25 | 26 | ENV ION_CUBE_PHP_VERSION "7.0" 27 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 28 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 29 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 30 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 31 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 32 | 33 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 34 | 35 | ADD entrypoint.sh /entrypoint.sh 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | 38 | RUN a2enmod rewrite headers 39 | 40 | COPY magento.conf /etc/apache2/conf-enabled/ 41 | 42 | CMD ["apache2-foreground"] 43 | -------------------------------------------------------------------------------- /7.0/apache/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /7.0/apache/magento.conf: -------------------------------------------------------------------------------- 1 | # Enable support for SSL termination 2 | SetEnvIf X-Forwarded-Proto https HTTPS=on 3 | -------------------------------------------------------------------------------- /7.0/apache/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.0/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.0-cli 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.7" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.0.3" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.6.1" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libmcrypt-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && docker-php-ext-install mcrypt \ 16 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 17 | && docker-php-ext-install pcntl \ 18 | && docker-php-ext-install pdo_mysql \ 19 | && docker-php-ext-install soap \ 20 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 21 | && docker-php-ext-install xsl \ 22 | && docker-php-ext-install zip \ 23 | && docker-php-ext-install intl \ 24 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 25 | 26 | ENV ION_CUBE_PHP_VERSION "7.0" 27 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 28 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 29 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 30 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 31 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 32 | 33 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 34 | 35 | ADD entrypoint.sh /entrypoint.sh 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | 38 | ENV BIN_DIR "/usr/local/bin" 39 | RUN apt-get update \ 40 | && apt-get install -y cron git groff mysql-client python-pip rsyslog sudo \ 41 | && sed -i '/imklog/s/^/#/' /etc/rsyslog.conf \ 42 | && pip install awscli \ 43 | && curl --retry 10 --retry-delay 3 https://getcomposer.org/installer | php -- --install-dir=$BIN_DIR --filename=composer \ 44 | && curl --retry 10 --retry-delay 3 -L https://github.com/punkstar/mageconfigsync/releases/download/0.4.0/mageconfigsync-0.4.0.phar -o $BIN_DIR/mageconfigsync && chmod +x $BIN_DIR/mageconfigsync \ 45 | && curl --retry 10 --retry-delay 3 -L https://github.com/meanbee/magedbm/releases/download/v1.6.0/magedbm.phar -o $BIN_DIR/magedbm.phar && chmod +x $BIN_DIR/magedbm.phar \ 46 | && curl --retry 10 --retry-delay 3 https://files.magerun.net/n98-magerun.phar -o $BIN_DIR/n98-magerun.phar && chmod +x $BIN_DIR/n98-magerun.phar \ 47 | && curl --retry 10 --retry-delay 3 https://raw.githubusercontent.com/colinmollenhour/modman/master/modman -o $BIN_DIR/modman && chmod +x $BIN_DIR/modman \ 48 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 49 | 50 | COPY bin/* $BIN_DIR/ 51 | ADD run-cron.sh /run-cron.sh 52 | 53 | CMD ["php", "-a"] 54 | -------------------------------------------------------------------------------- /7.0/cli/bin/magedbm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | magedbm.phar configure \ 4 | --key="$AWS_ACCESS_KEY_ID" \ 5 | --secret="$AWS_SECRET_ACCESS_KEY" \ 6 | --region="$AWS_REGION" \ 7 | --bucket="$AWS_BUCKET" 8 | 9 | exec magedbm.phar "$@" 10 | -------------------------------------------------------------------------------- /7.0/cli/bin/magemm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # magemm - sync media images from S3 4 | # 5 | 6 | set -e # Exit on error 7 | 8 | # Parameters 9 | ############################# 10 | 11 | project=$1 12 | destination=$(pwd)/media/ 13 | 14 | # Usage 15 | ############################# 16 | 17 | [ "$project" = "-h" -o "$project" = "--help" ] \ 18 | && cat << USAGE && exit 0 19 | Usage: $0 project-name 20 | 21 | Sync the media images from S3 into $destination 22 | USAGE 23 | 24 | # Validation 25 | ############################# 26 | 27 | [ -z "$project" ] \ 28 | && echo "project-name parameter required!" \ 29 | && exit 1 30 | 31 | [ -z "$AWS_ACCESS_KEY_ID" -o -z "$AWS_SECRET_ACCESS_KEY" -o -z "$AWS_REGION" -o -z "$AWS_MEDIA_BUCKET" ] \ 32 | && echo '$AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY, $AWS_REGION and $AWS_MEDIA_BUCKET environment variables required!' \ 33 | && exit 1 34 | 35 | # Main 36 | ############################# 37 | 38 | aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID 39 | aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY 40 | aws configure set default.region $AWS_REGION 41 | 42 | exec aws s3 sync --delete s3://$AWS_MEDIA_BUCKET/$project/media/ $destination 43 | -------------------------------------------------------------------------------- /7.0/cli/bin/magerun: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exec sudo -u www-data -- n98-magerun.phar "$@" 4 | -------------------------------------------------------------------------------- /7.0/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | CRON_LOG=/var/log/cron.log 6 | 7 | # Setup Magento cron 8 | echo "* * * * * root su www-data -s /bin/bash -c 'sh $(pwd)/cron.sh'" > /etc/cron.d/magento 9 | 10 | # Get rsyslog running for cron output 11 | touch $CRON_LOG 12 | echo "cron.* $CRON_LOG" > /etc/rsyslog.d/cron.conf 13 | service rsyslog start 14 | 15 | # Configure Sendmail if required 16 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 17 | /etc/init.d/sendmail start 18 | fi 19 | 20 | # Configure Xdebug 21 | if [ "$XDEBUG_CONFIG" ]; then 22 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 23 | for config in $XDEBUG_CONFIG; do 24 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 25 | done 26 | fi 27 | 28 | # Execute the supplied command 29 | exec "$@" 30 | -------------------------------------------------------------------------------- /7.0/cli/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.0/cli/run-cron.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && \ 4 | tail -f -n0 /var/log/cron.log 5 | -------------------------------------------------------------------------------- /7.0/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.0-fpm 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.7" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.0.3" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.6.1" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libmcrypt-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && docker-php-ext-install mcrypt \ 16 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 17 | && docker-php-ext-install pcntl \ 18 | && docker-php-ext-install pdo_mysql \ 19 | && docker-php-ext-install soap \ 20 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 21 | && docker-php-ext-install xsl \ 22 | && docker-php-ext-install zip \ 23 | && docker-php-ext-install intl \ 24 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 25 | 26 | ENV ION_CUBE_PHP_VERSION "7.0" 27 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 28 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 29 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 30 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 31 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 32 | 33 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 34 | 35 | ADD entrypoint.sh /entrypoint.sh 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | 38 | CMD ["php-fpm"] 39 | -------------------------------------------------------------------------------- /7.0/fpm/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /7.0/fpm/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.1/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.1-apache 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.7" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.0.3" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.6.1" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libmcrypt-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && docker-php-ext-install mcrypt \ 16 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 17 | && docker-php-ext-install pcntl \ 18 | && docker-php-ext-install pdo_mysql \ 19 | && docker-php-ext-install soap \ 20 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 21 | && docker-php-ext-install xsl \ 22 | && docker-php-ext-install zip \ 23 | && docker-php-ext-install intl \ 24 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 25 | 26 | ENV ION_CUBE_PHP_VERSION "7.1" 27 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 28 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 29 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 30 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 31 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 32 | 33 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 34 | 35 | ADD entrypoint.sh /entrypoint.sh 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | 38 | RUN a2enmod rewrite headers 39 | 40 | COPY magento.conf /etc/apache2/conf-enabled/ 41 | 42 | CMD ["apache2-foreground"] 43 | -------------------------------------------------------------------------------- /7.1/apache/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /7.1/apache/magento.conf: -------------------------------------------------------------------------------- 1 | # Enable support for SSL termination 2 | SetEnvIf X-Forwarded-Proto https HTTPS=on 3 | -------------------------------------------------------------------------------- /7.1/apache/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.1/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.1-cli 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.7" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.0.3" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.6.1" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libmcrypt-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && docker-php-ext-install mcrypt \ 16 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 17 | && docker-php-ext-install pcntl \ 18 | && docker-php-ext-install pdo_mysql \ 19 | && docker-php-ext-install soap \ 20 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 21 | && docker-php-ext-install xsl \ 22 | && docker-php-ext-install zip \ 23 | && docker-php-ext-install intl \ 24 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 25 | 26 | ENV ION_CUBE_PHP_VERSION "7.1" 27 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 28 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 29 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 30 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 31 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 32 | 33 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 34 | 35 | ADD entrypoint.sh /entrypoint.sh 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | 38 | ENV BIN_DIR "/usr/local/bin" 39 | RUN apt-get update \ 40 | && apt-get install -y cron git groff default-mysql-client python-pip rsyslog sudo \ 41 | && sed -i '/imklog/s/^/#/' /etc/rsyslog.conf \ 42 | && pip install awscli \ 43 | && curl --retry 10 --retry-delay 3 https://getcomposer.org/installer | php -- --install-dir=$BIN_DIR --filename=composer \ 44 | && curl --retry 10 --retry-delay 3 -L https://github.com/punkstar/mageconfigsync/releases/download/0.4.0/mageconfigsync-0.4.0.phar -o $BIN_DIR/mageconfigsync && chmod +x $BIN_DIR/mageconfigsync \ 45 | && curl --retry 10 --retry-delay 3 -L https://github.com/meanbee/magedbm/releases/download/v1.6.0/magedbm.phar -o $BIN_DIR/magedbm.phar && chmod +x $BIN_DIR/magedbm.phar \ 46 | && curl --retry 10 --retry-delay 3 https://files.magerun.net/n98-magerun.phar -o $BIN_DIR/n98-magerun.phar && chmod +x $BIN_DIR/n98-magerun.phar \ 47 | && curl --retry 10 --retry-delay 3 https://raw.githubusercontent.com/colinmollenhour/modman/master/modman -o $BIN_DIR/modman && chmod +x $BIN_DIR/modman \ 48 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 49 | 50 | COPY bin/* $BIN_DIR/ 51 | ADD run-cron.sh /run-cron.sh 52 | 53 | CMD ["php", "-a"] 54 | -------------------------------------------------------------------------------- /7.1/cli/bin/magedbm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | magedbm.phar configure \ 4 | --key="$AWS_ACCESS_KEY_ID" \ 5 | --secret="$AWS_SECRET_ACCESS_KEY" \ 6 | --region="$AWS_REGION" \ 7 | --bucket="$AWS_BUCKET" 8 | 9 | exec magedbm.phar "$@" 10 | -------------------------------------------------------------------------------- /7.1/cli/bin/magemm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # magemm - sync media images from S3 4 | # 5 | 6 | set -e # Exit on error 7 | 8 | # Parameters 9 | ############################# 10 | 11 | project=$1 12 | destination=$(pwd)/media/ 13 | 14 | # Usage 15 | ############################# 16 | 17 | [ "$project" = "-h" -o "$project" = "--help" ] \ 18 | && cat << USAGE && exit 0 19 | Usage: $0 project-name 20 | 21 | Sync the media images from S3 into $destination 22 | USAGE 23 | 24 | # Validation 25 | ############################# 26 | 27 | [ -z "$project" ] \ 28 | && echo "project-name parameter required!" \ 29 | && exit 1 30 | 31 | [ -z "$AWS_ACCESS_KEY_ID" -o -z "$AWS_SECRET_ACCESS_KEY" -o -z "$AWS_REGION" -o -z "$AWS_MEDIA_BUCKET" ] \ 32 | && echo '$AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY, $AWS_REGION and $AWS_MEDIA_BUCKET environment variables required!' \ 33 | && exit 1 34 | 35 | # Main 36 | ############################# 37 | 38 | aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID 39 | aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY 40 | aws configure set default.region $AWS_REGION 41 | 42 | exec aws s3 sync --delete s3://$AWS_MEDIA_BUCKET/$project/media/ $destination 43 | -------------------------------------------------------------------------------- /7.1/cli/bin/magerun: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exec sudo -u www-data -- n98-magerun.phar "$@" 4 | -------------------------------------------------------------------------------- /7.1/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | CRON_LOG=/var/log/cron.log 6 | 7 | # Setup Magento cron 8 | echo "* * * * * root su www-data -s /bin/bash -c 'sh $(pwd)/cron.sh'" > /etc/cron.d/magento 9 | 10 | # Get rsyslog running for cron output 11 | touch $CRON_LOG 12 | echo "cron.* $CRON_LOG" > /etc/rsyslog.d/cron.conf 13 | service rsyslog start 14 | 15 | # Configure Sendmail if required 16 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 17 | /etc/init.d/sendmail start 18 | fi 19 | 20 | # Configure Xdebug 21 | if [ "$XDEBUG_CONFIG" ]; then 22 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 23 | for config in $XDEBUG_CONFIG; do 24 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 25 | done 26 | fi 27 | 28 | # Execute the supplied command 29 | exec "$@" 30 | -------------------------------------------------------------------------------- /7.1/cli/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.1/cli/run-cron.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && \ 4 | tail -f -n0 /var/log/cron.log 5 | -------------------------------------------------------------------------------- /7.1/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.1-fpm 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.7" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.0.3" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.6.1" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libmcrypt-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && docker-php-ext-install mcrypt \ 16 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 17 | && docker-php-ext-install pcntl \ 18 | && docker-php-ext-install pdo_mysql \ 19 | && docker-php-ext-install soap \ 20 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 21 | && docker-php-ext-install xsl \ 22 | && docker-php-ext-install zip \ 23 | && docker-php-ext-install intl \ 24 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 25 | 26 | ENV ION_CUBE_PHP_VERSION "7.1" 27 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 28 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 29 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 30 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 31 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 32 | 33 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 34 | 35 | ADD entrypoint.sh /entrypoint.sh 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | 38 | CMD ["php-fpm"] 39 | -------------------------------------------------------------------------------- /7.1/fpm/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /7.1/fpm/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.2/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.2-apache 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.12" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.0.4" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.6.1" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 16 | && docker-php-ext-install pcntl \ 17 | && docker-php-ext-install pdo_mysql \ 18 | && docker-php-ext-install soap \ 19 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 20 | && docker-php-ext-install xsl \ 21 | && docker-php-ext-install zip \ 22 | && docker-php-ext-install intl \ 23 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | ENV ION_CUBE_PHP_VERSION "7.2" 26 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 27 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 28 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 29 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 30 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 31 | 32 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 33 | 34 | ADD entrypoint.sh /entrypoint.sh 35 | ENTRYPOINT ["/entrypoint.sh"] 36 | 37 | RUN a2enmod rewrite headers 38 | 39 | COPY magento.conf /etc/apache2/conf-enabled/ 40 | 41 | CMD ["apache2-foreground"] 42 | -------------------------------------------------------------------------------- /7.2/apache/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /7.2/apache/magento.conf: -------------------------------------------------------------------------------- 1 | # Enable support for SSL termination 2 | SetEnvIf X-Forwarded-Proto https HTTPS=on 3 | -------------------------------------------------------------------------------- /7.2/apache/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.2/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.2-cli 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.12" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.0.4" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.6.1" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 16 | && docker-php-ext-install pcntl \ 17 | && docker-php-ext-install pdo_mysql \ 18 | && docker-php-ext-install soap \ 19 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 20 | && docker-php-ext-install xsl \ 21 | && docker-php-ext-install zip \ 22 | && docker-php-ext-install intl \ 23 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | ENV ION_CUBE_PHP_VERSION "7.2" 26 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 27 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 28 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 29 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 30 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 31 | 32 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 33 | 34 | ADD entrypoint.sh /entrypoint.sh 35 | ENTRYPOINT ["/entrypoint.sh"] 36 | 37 | ENV BIN_DIR "/usr/local/bin" 38 | RUN apt-get update \ 39 | && apt-get install -y cron git groff default-mysql-client python-pip rsyslog sudo \ 40 | && sed -i '/imklog/s/^/#/' /etc/rsyslog.conf \ 41 | && pip install awscli \ 42 | && curl --retry 10 --retry-delay 3 https://getcomposer.org/installer | php -- --install-dir=$BIN_DIR --filename=composer \ 43 | && curl --retry 10 --retry-delay 3 -L https://github.com/punkstar/mageconfigsync/releases/download/0.4.0/mageconfigsync-0.4.0.phar -o $BIN_DIR/mageconfigsync && chmod +x $BIN_DIR/mageconfigsync \ 44 | && curl --retry 10 --retry-delay 3 -L https://github.com/meanbee/magedbm/releases/download/v1.6.0/magedbm.phar -o $BIN_DIR/magedbm.phar && chmod +x $BIN_DIR/magedbm.phar \ 45 | && curl --retry 10 --retry-delay 3 https://files.magerun.net/n98-magerun.phar -o $BIN_DIR/n98-magerun.phar && chmod +x $BIN_DIR/n98-magerun.phar \ 46 | && curl --retry 10 --retry-delay 3 https://raw.githubusercontent.com/colinmollenhour/modman/master/modman -o $BIN_DIR/modman && chmod +x $BIN_DIR/modman \ 47 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 48 | 49 | COPY bin/* $BIN_DIR/ 50 | ADD run-cron.sh /run-cron.sh 51 | 52 | CMD ["php", "-a"] 53 | -------------------------------------------------------------------------------- /7.2/cli/bin/magedbm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | magedbm.phar configure \ 4 | --key="$AWS_ACCESS_KEY_ID" \ 5 | --secret="$AWS_SECRET_ACCESS_KEY" \ 6 | --region="$AWS_REGION" \ 7 | --bucket="$AWS_BUCKET" 8 | 9 | exec magedbm.phar "$@" 10 | -------------------------------------------------------------------------------- /7.2/cli/bin/magemm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # magemm - sync media images from S3 4 | # 5 | 6 | set -e # Exit on error 7 | 8 | # Parameters 9 | ############################# 10 | 11 | project=$1 12 | destination=$(pwd)/media/ 13 | 14 | # Usage 15 | ############################# 16 | 17 | [ "$project" = "-h" -o "$project" = "--help" ] \ 18 | && cat << USAGE && exit 0 19 | Usage: $0 project-name 20 | 21 | Sync the media images from S3 into $destination 22 | USAGE 23 | 24 | # Validation 25 | ############################# 26 | 27 | [ -z "$project" ] \ 28 | && echo "project-name parameter required!" \ 29 | && exit 1 30 | 31 | [ -z "$AWS_ACCESS_KEY_ID" -o -z "$AWS_SECRET_ACCESS_KEY" -o -z "$AWS_REGION" -o -z "$AWS_MEDIA_BUCKET" ] \ 32 | && echo '$AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY, $AWS_REGION and $AWS_MEDIA_BUCKET environment variables required!' \ 33 | && exit 1 34 | 35 | # Main 36 | ############################# 37 | 38 | aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID 39 | aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY 40 | aws configure set default.region $AWS_REGION 41 | 42 | exec aws s3 sync --delete s3://$AWS_MEDIA_BUCKET/$project/media/ $destination 43 | -------------------------------------------------------------------------------- /7.2/cli/bin/magerun: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exec sudo -u www-data -- n98-magerun.phar "$@" 4 | -------------------------------------------------------------------------------- /7.2/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | CRON_LOG=/var/log/cron.log 6 | 7 | # Setup Magento cron 8 | echo "* * * * * root su www-data -s /bin/bash -c 'sh $(pwd)/cron.sh'" > /etc/cron.d/magento 9 | 10 | # Get rsyslog running for cron output 11 | touch $CRON_LOG 12 | echo "cron.* $CRON_LOG" > /etc/rsyslog.d/cron.conf 13 | service rsyslog start 14 | 15 | # Configure Sendmail if required 16 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 17 | /etc/init.d/sendmail start 18 | fi 19 | 20 | # Configure Xdebug 21 | if [ "$XDEBUG_CONFIG" ]; then 22 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 23 | for config in $XDEBUG_CONFIG; do 24 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 25 | done 26 | fi 27 | 28 | # Execute the supplied command 29 | exec "$@" 30 | -------------------------------------------------------------------------------- /7.2/cli/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.2/cli/run-cron.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && \ 4 | tail -f -n0 /var/log/cron.log 5 | -------------------------------------------------------------------------------- /7.2/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.2-fpm 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.12" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.0.4" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.6.1" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 16 | && docker-php-ext-install pcntl \ 17 | && docker-php-ext-install pdo_mysql \ 18 | && docker-php-ext-install soap \ 19 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 20 | && docker-php-ext-install xsl \ 21 | && docker-php-ext-install zip \ 22 | && docker-php-ext-install intl \ 23 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | ENV ION_CUBE_PHP_VERSION "7.2" 26 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 27 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 28 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 29 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 30 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 31 | 32 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 33 | 34 | ADD entrypoint.sh /entrypoint.sh 35 | ENTRYPOINT ["/entrypoint.sh"] 36 | 37 | CMD ["php-fpm"] 38 | -------------------------------------------------------------------------------- /7.2/fpm/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /7.2/fpm/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.3/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.3-apache 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.18" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.1.5" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.9.0" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libzip-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 16 | && docker-php-ext-install pcntl \ 17 | && docker-php-ext-install pdo_mysql \ 18 | && docker-php-ext-install soap \ 19 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 20 | && docker-php-ext-install xsl \ 21 | && docker-php-ext-install zip \ 22 | && docker-php-ext-install intl \ 23 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | ENV ION_CUBE_PHP_VERSION "7.3" 26 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 27 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 28 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 29 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 30 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 31 | 32 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 33 | 34 | ADD entrypoint.sh /entrypoint.sh 35 | ENTRYPOINT ["/entrypoint.sh"] 36 | 37 | RUN a2enmod rewrite headers 38 | 39 | COPY magento.conf /etc/apache2/conf-enabled/ 40 | 41 | CMD ["apache2-foreground"] 42 | -------------------------------------------------------------------------------- /7.3/apache/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /7.3/apache/magento.conf: -------------------------------------------------------------------------------- 1 | # Enable support for SSL termination 2 | SetEnvIf X-Forwarded-Proto https HTTPS=on 3 | -------------------------------------------------------------------------------- /7.3/apache/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.3/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.3-cli 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.18" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.1.5" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.9.0" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libzip-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 16 | && docker-php-ext-install pcntl \ 17 | && docker-php-ext-install pdo_mysql \ 18 | && docker-php-ext-install soap \ 19 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 20 | && docker-php-ext-install xsl \ 21 | && docker-php-ext-install zip \ 22 | && docker-php-ext-install intl \ 23 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | ENV ION_CUBE_PHP_VERSION "7.3" 26 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 27 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 28 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 29 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 30 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 31 | 32 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 33 | 34 | ADD entrypoint.sh /entrypoint.sh 35 | ENTRYPOINT ["/entrypoint.sh"] 36 | 37 | ENV BIN_DIR "/usr/local/bin" 38 | RUN apt-get update \ 39 | && apt-get install -y cron git groff default-mysql-client python-pip rsyslog sudo \ 40 | && sed -i '/imklog/s/^/#/' /etc/rsyslog.conf \ 41 | && pip install awscli \ 42 | && curl --retry 10 --retry-delay 3 https://getcomposer.org/installer | php -- --install-dir=$BIN_DIR --filename=composer \ 43 | && curl --retry 10 --retry-delay 3 -L https://github.com/punkstar/mageconfigsync/releases/download/0.4.0/mageconfigsync-0.4.0.phar -o $BIN_DIR/mageconfigsync && chmod +x $BIN_DIR/mageconfigsync \ 44 | && curl --retry 10 --retry-delay 3 -L https://github.com/meanbee/magedbm/releases/download/v1.6.0/magedbm.phar -o $BIN_DIR/magedbm.phar && chmod +x $BIN_DIR/magedbm.phar \ 45 | && curl --retry 10 --retry-delay 3 https://files.magerun.net/n98-magerun.phar -o $BIN_DIR/n98-magerun.phar && chmod +x $BIN_DIR/n98-magerun.phar \ 46 | && curl --retry 10 --retry-delay 3 https://raw.githubusercontent.com/colinmollenhour/modman/master/modman -o $BIN_DIR/modman && chmod +x $BIN_DIR/modman \ 47 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 48 | 49 | COPY bin/* $BIN_DIR/ 50 | ADD run-cron.sh /run-cron.sh 51 | 52 | CMD ["php", "-a"] 53 | -------------------------------------------------------------------------------- /7.3/cli/bin/magedbm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | magedbm.phar configure \ 4 | --key="$AWS_ACCESS_KEY_ID" \ 5 | --secret="$AWS_SECRET_ACCESS_KEY" \ 6 | --region="$AWS_REGION" \ 7 | --bucket="$AWS_BUCKET" 8 | 9 | exec magedbm.phar "$@" 10 | -------------------------------------------------------------------------------- /7.3/cli/bin/magemm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # magemm - sync media images from S3 4 | # 5 | 6 | set -e # Exit on error 7 | 8 | # Parameters 9 | ############################# 10 | 11 | project=$1 12 | destination=$(pwd)/media/ 13 | 14 | # Usage 15 | ############################# 16 | 17 | [ "$project" = "-h" -o "$project" = "--help" ] \ 18 | && cat << USAGE && exit 0 19 | Usage: $0 project-name 20 | 21 | Sync the media images from S3 into $destination 22 | USAGE 23 | 24 | # Validation 25 | ############################# 26 | 27 | [ -z "$project" ] \ 28 | && echo "project-name parameter required!" \ 29 | && exit 1 30 | 31 | [ -z "$AWS_ACCESS_KEY_ID" -o -z "$AWS_SECRET_ACCESS_KEY" -o -z "$AWS_REGION" -o -z "$AWS_MEDIA_BUCKET" ] \ 32 | && echo '$AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY, $AWS_REGION and $AWS_MEDIA_BUCKET environment variables required!' \ 33 | && exit 1 34 | 35 | # Main 36 | ############################# 37 | 38 | aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID 39 | aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY 40 | aws configure set default.region $AWS_REGION 41 | 42 | exec aws s3 sync --delete s3://$AWS_MEDIA_BUCKET/$project/media/ $destination 43 | -------------------------------------------------------------------------------- /7.3/cli/bin/magerun: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exec sudo -u www-data -- n98-magerun.phar "$@" 4 | -------------------------------------------------------------------------------- /7.3/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | CRON_LOG=/var/log/cron.log 6 | 7 | # Setup Magento cron 8 | echo "* * * * * root su www-data -s /bin/bash -c 'sh $(pwd)/cron.sh'" > /etc/cron.d/magento 9 | 10 | # Get rsyslog running for cron output 11 | touch $CRON_LOG 12 | echo "cron.* $CRON_LOG" > /etc/rsyslog.d/cron.conf 13 | service rsyslog start 14 | 15 | # Configure Sendmail if required 16 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 17 | /etc/init.d/sendmail start 18 | fi 19 | 20 | # Configure Xdebug 21 | if [ "$XDEBUG_CONFIG" ]; then 22 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 23 | for config in $XDEBUG_CONFIG; do 24 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 25 | done 26 | fi 27 | 28 | # Execute the supplied command 29 | exec "$@" 30 | -------------------------------------------------------------------------------- /7.3/cli/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.3/cli/run-cron.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && \ 4 | tail -f -n0 /var/log/cron.log 5 | -------------------------------------------------------------------------------- /7.3/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.3-fpm 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.18" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.1.5" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.9.0" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libzip-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 16 | && docker-php-ext-install pcntl \ 17 | && docker-php-ext-install pdo_mysql \ 18 | && docker-php-ext-install soap \ 19 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 20 | && docker-php-ext-install xsl \ 21 | && docker-php-ext-install zip \ 22 | && docker-php-ext-install intl \ 23 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | ENV ION_CUBE_PHP_VERSION "7.3" 26 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 27 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 28 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 29 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 30 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 31 | 32 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 33 | 34 | ADD entrypoint.sh /entrypoint.sh 35 | ENTRYPOINT ["/entrypoint.sh"] 36 | 37 | CMD ["php-fpm"] 38 | -------------------------------------------------------------------------------- /7.3/fpm/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /7.3/fpm/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.4/apache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.4-apache 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.18" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.1.5" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.9.0" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libzip-dev libonig-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype --with-jpeg \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 16 | && docker-php-ext-install pcntl \ 17 | && docker-php-ext-install pdo_mysql \ 18 | && docker-php-ext-install soap \ 19 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 20 | && docker-php-ext-install xsl \ 21 | && docker-php-ext-install zip \ 22 | && docker-php-ext-install intl \ 23 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | 26 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 27 | 28 | ADD entrypoint.sh /entrypoint.sh 29 | ENTRYPOINT ["/entrypoint.sh"] 30 | 31 | RUN a2enmod rewrite headers 32 | 33 | COPY magento.conf /etc/apache2/conf-enabled/ 34 | 35 | CMD ["apache2-foreground"] 36 | -------------------------------------------------------------------------------- /7.4/apache/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /7.4/apache/magento.conf: -------------------------------------------------------------------------------- 1 | # Enable support for SSL termination 2 | SetEnvIf X-Forwarded-Proto https HTTPS=on 3 | -------------------------------------------------------------------------------- /7.4/apache/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.4/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.4-cli 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.18" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.1.5" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.9.0" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libzip-dev libonig-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype --with-jpeg \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 16 | && docker-php-ext-install pcntl \ 17 | && docker-php-ext-install pdo_mysql \ 18 | && docker-php-ext-install soap \ 19 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 20 | && docker-php-ext-install xsl \ 21 | && docker-php-ext-install zip \ 22 | && docker-php-ext-install intl \ 23 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | 26 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 27 | 28 | ADD entrypoint.sh /entrypoint.sh 29 | ENTRYPOINT ["/entrypoint.sh"] 30 | 31 | ENV BIN_DIR "/usr/local/bin" 32 | RUN apt-get update \ 33 | && apt-get install -y cron git groff default-mysql-client python-pip rsyslog sudo \ 34 | && sed -i '/imklog/s/^/#/' /etc/rsyslog.conf \ 35 | && pip install awscli \ 36 | && curl --retry 10 --retry-delay 3 https://getcomposer.org/installer | php -- --install-dir=$BIN_DIR --filename=composer \ 37 | && curl --retry 10 --retry-delay 3 -L https://github.com/punkstar/mageconfigsync/releases/download/0.4.0/mageconfigsync-0.4.0.phar -o $BIN_DIR/mageconfigsync && chmod +x $BIN_DIR/mageconfigsync \ 38 | && curl --retry 10 --retry-delay 3 -L https://github.com/meanbee/magedbm/releases/download/v1.6.0/magedbm.phar -o $BIN_DIR/magedbm.phar && chmod +x $BIN_DIR/magedbm.phar \ 39 | && curl --retry 10 --retry-delay 3 https://files.magerun.net/n98-magerun.phar -o $BIN_DIR/n98-magerun.phar && chmod +x $BIN_DIR/n98-magerun.phar \ 40 | && curl --retry 10 --retry-delay 3 https://raw.githubusercontent.com/colinmollenhour/modman/master/modman -o $BIN_DIR/modman && chmod +x $BIN_DIR/modman \ 41 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 42 | 43 | COPY bin/* $BIN_DIR/ 44 | ADD run-cron.sh /run-cron.sh 45 | 46 | CMD ["php", "-a"] 47 | -------------------------------------------------------------------------------- /7.4/cli/bin/magedbm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | magedbm.phar configure \ 4 | --key="$AWS_ACCESS_KEY_ID" \ 5 | --secret="$AWS_SECRET_ACCESS_KEY" \ 6 | --region="$AWS_REGION" \ 7 | --bucket="$AWS_BUCKET" 8 | 9 | exec magedbm.phar "$@" 10 | -------------------------------------------------------------------------------- /7.4/cli/bin/magemm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # magemm - sync media images from S3 4 | # 5 | 6 | set -e # Exit on error 7 | 8 | # Parameters 9 | ############################# 10 | 11 | project=$1 12 | destination=$(pwd)/media/ 13 | 14 | # Usage 15 | ############################# 16 | 17 | [ "$project" = "-h" -o "$project" = "--help" ] \ 18 | && cat << USAGE && exit 0 19 | Usage: $0 project-name 20 | 21 | Sync the media images from S3 into $destination 22 | USAGE 23 | 24 | # Validation 25 | ############################# 26 | 27 | [ -z "$project" ] \ 28 | && echo "project-name parameter required!" \ 29 | && exit 1 30 | 31 | [ -z "$AWS_ACCESS_KEY_ID" -o -z "$AWS_SECRET_ACCESS_KEY" -o -z "$AWS_REGION" -o -z "$AWS_MEDIA_BUCKET" ] \ 32 | && echo '$AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY, $AWS_REGION and $AWS_MEDIA_BUCKET environment variables required!' \ 33 | && exit 1 34 | 35 | # Main 36 | ############################# 37 | 38 | aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID 39 | aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY 40 | aws configure set default.region $AWS_REGION 41 | 42 | exec aws s3 sync --delete s3://$AWS_MEDIA_BUCKET/$project/media/ $destination 43 | -------------------------------------------------------------------------------- /7.4/cli/bin/magerun: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exec sudo -u www-data -- n98-magerun.phar "$@" 4 | -------------------------------------------------------------------------------- /7.4/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | CRON_LOG=/var/log/cron.log 6 | 7 | # Setup Magento cron 8 | echo "* * * * * root su www-data -s /bin/bash -c 'sh $(pwd)/cron.sh'" > /etc/cron.d/magento 9 | 10 | # Get rsyslog running for cron output 11 | touch $CRON_LOG 12 | echo "cron.* $CRON_LOG" > /etc/rsyslog.d/cron.conf 13 | service rsyslog start 14 | 15 | # Configure Sendmail if required 16 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 17 | /etc/init.d/sendmail start 18 | fi 19 | 20 | # Configure Xdebug 21 | if [ "$XDEBUG_CONFIG" ]; then 22 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 23 | for config in $XDEBUG_CONFIG; do 24 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 25 | done 26 | fi 27 | 28 | # Execute the supplied command 29 | exec "$@" 30 | -------------------------------------------------------------------------------- /7.4/cli/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /7.4/cli/run-cron.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && \ 4 | tail -f -n0 /var/log/cron.log 5 | -------------------------------------------------------------------------------- /7.4/fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.4-fpm 2 | MAINTAINER Tomas Gerulaitis 3 | 4 | ENV PHP_EXT_APCU_VERSION "5.1.18" 5 | ENV PHP_EXT_MEMCACHED_VERSION "3.1.5" 6 | ENV PHP_EXT_XDEBUG_VERSION "2.9.0" 7 | 8 | 9 | RUN build_packages="libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxml2-dev libxslt1-dev libmemcached-dev sendmail-bin sendmail libicu-dev libzip-dev libonig-dev" \ 10 | && apt-get update && apt-get install -y $build_packages \ 11 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 12 | && docker-php-ext-configure gd --with-freetype --with-jpeg \ 13 | && docker-php-ext-install gd \ 14 | && docker-php-ext-install mbstring \ 15 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 16 | && docker-php-ext-install pcntl \ 17 | && docker-php-ext-install pdo_mysql \ 18 | && docker-php-ext-install soap \ 19 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 20 | && docker-php-ext-install xsl \ 21 | && docker-php-ext-install zip \ 22 | && docker-php-ext-install intl \ 23 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | 26 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 27 | 28 | ADD entrypoint.sh /entrypoint.sh 29 | ENTRYPOINT ["/entrypoint.sh"] 30 | 31 | CMD ["php-fpm"] 32 | -------------------------------------------------------------------------------- /7.4/fpm/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | # Configure Sendmail if required 7 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 8 | /etc/init.d/sendmail start 9 | fi 10 | 11 | # Configure Xdebug 12 | if [ "$XDEBUG_CONFIG" ]; then 13 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 14 | for config in $XDEBUG_CONFIG; do 15 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 16 | done 17 | fi 18 | 19 | # Execute the supplied command 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /7.4/fpm/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 meanbee 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # meanbee/magento 2 | 3 | [![Build Status][ico-travis]][link-travis] 4 | [![Docker Build Status][ico-dockerbuild]][link-dockerhub] 5 | [![Docker Pulls][ico-downloads]][link-dockerhub] 6 | [![Docker Stars][ico-dockerstars]][link-dockerhub] 7 | 8 | A collection of Docker images for running Magento application web servers and command line tools. 9 | 10 | # Supported tags and respective `Dockerfile` links 11 | 12 | - [`7.4-apache` (*7.4/apache/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.4/apache/Dockerfile) 13 | - [`7.4-cli` (*7.4/cli/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.4/cli/Dockerfile) 14 | - [`7.4-fpm` (*7.4/fpm/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.4/fpm/Dockerfile) 15 | - [`7.3-apache` (*7.3/apache/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.3/apache/Dockerfile) 16 | - [`7.3-cli` (*7.3/cli/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.3/cli/Dockerfile) 17 | - [`7.3-fpm` (*7.3/fpm/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.3/fpm/Dockerfile) 18 | - [`7.2-apache` (*7.2/apache/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.2/apache/Dockerfile) 19 | - [`7.2-cli` (*7.2/cli/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.2/cli/Dockerfile) 20 | - [`7.2-fpm` (*7.2/fpm/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.2/fpm/Dockerfile) 21 | - [`7.1-apache` (*7.1/apache/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.1/apache/Dockerfile) 22 | - [`7.1-cli` (*7.1/cli/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.1/cli/Dockerfile) 23 | - [`7.1-fpm` (*7.1/fpm/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.1/fpm/Dockerfile) 24 | - [`7.0-apache` (*7.0/apache/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.0/apache/Dockerfile) 25 | - [`7.0-cli` (*7.0/cli/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.0/cli/Dockerfile) 26 | - [`7.0-fpm` (*7.0/fpm/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/7.0/fpm/Dockerfile) 27 | - [`5.6-apache` (*5.6/apache/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/5.6/apache/Dockerfile) 28 | - [`5.6-cli` (*5.6/cli/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/5.6/cli/Dockerfile) 29 | - [`5.6-fpm` (*5.6/fpm/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/5.6/fpm/Dockerfile) 30 | - [`5.5-apache` (*5.5/apache/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/5.5/apache/Dockerfile) 31 | - [`5.5-cli` (*5.5/cli/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/5.5/cli/Dockerfile) 32 | - [`5.5-fpm` (*5.5/fpm/Dockerfile*)](https://github.com/meanbee/docker-magento/blob/master/5.5/fpm/Dockerfile) 33 | 34 | # Usage 35 | 36 | Since Magento requires several services working together, it recommended to use docker-compose with these images. 37 | 38 | See [docker-compose.yml](docker-compose.yml) for a sample configuration. 39 | 40 | # Options 41 | 42 | ## Sendmail 43 | 44 | All images have sendmail installed for emails, however it is not enabled by default. To enable sendmail, use the following environment variable: 45 | 46 | ENABLE_SENDMAIL=true 47 | 48 | *Note:* If sendmail has been enabled, make sure the container has a hostname assigned using the `hostname` field in `docker-compose.yml` or `--hostname` parameter for `docker run`. If the container does not have a hostname set, sendmail will attempt to discover the hostname on startup, blocking for a prolonged period of time. 49 | 50 | ## Xdebug 51 | 52 | Xdebug is installed and enabled on all the images by default. To configure it for remote debugging, start 53 | the container with the following environment variable set (replacing the `{}` placeholders with appropriate values): 54 | 55 | XDEBUG_CONFIG="remote_connect_back=1 remote_enable=1 idekey={IDEKEY}" 56 | 57 | Note: If you're using PhpStorm, your IDE Key is probably `phpstorm`. 58 | 59 | # Command Line Tools 60 | 61 | The `cli` images have a number of useful Magento tools pre-installed: 62 | 63 | - [composer](https://getcomposer.org/) - Install and manage PHP package dependencies 64 | - [mageconfigsync](https://github.com/punkstar/mageconfigsync) - Backup and restore Magento System Configuration 65 | - [magedbm](https://github.com/meanbee/magedbm) - Create development backups of the Magento database using S3 and import them 66 | - magemm - Sync media images from an S3 backup 67 | - [modman](https://github.com/colinmollenhour/modman) - Install Magento extensions 68 | - [magerun](https://github.com/netz98/n98-magerun) - Run command line commands in Magento 69 | 70 | All of the installed tools run in the working directory of the container, so don't forget to set it using the `working_dir` service configuration option in `docker-compose.yml` or the `--workdir` parameter to `docker run`. 71 | 72 | Some of the commands use additional environment variables for configuration: 73 | 74 | - `AWS_ACCESS_KEY_ID` _(magedbm, magemm)_ Credentials for S3 connections 75 | - `AWS_SECRET_ACCESS_KEY` _(magedbm, magemm)_ Credentials for S3 connections 76 | - `AWS_REGION` _(magedbm, magemm)_ S3 region to use 77 | - `AWS_BUCKET` _(magedbm)_ S3 bucket to use for database backups 78 | - `AWS_MEDIA_BUCKET` _(magemm)_ S3 bucket to fetch media images from 79 | 80 | # Building 81 | 82 | A lot of the configuration for each image is the same, with the difference being the base image that they're extending from. For this reason we use `php` to build the `Dockerfile` from a set of templates in `src/`. The `Dockerfile` should still be published to the repository due to Docker Hub needing a `Dockerfile` to build from. 83 | 84 | To build all `Dockerfile`s, run the `builder.php` script in the `php:7` Docker image: 85 | 86 | docker run --rm -it -v $(pwd):/src php:7 php /src/builder.php 87 | 88 | ## Adding new images to the build config 89 | 90 | The build configuration is controlled by the `config.json` file. Yeah element in the top level hash is a new build target, using the following syntax: 91 | 92 | "": { 93 | "version": "", 94 | "flavour": "", 95 | "files": { 96 | "": { 97 | "": "", 98 | ... 99 | }, 100 | } 101 | 102 | The target files will be rendered in the `//` directory. 103 | 104 | The source template for each target file is selected from the `src/` directory using the following fallback order: 105 | 106 | 1. `--` 107 | 2. `-` 108 | 3. `-` 109 | 4. `` 110 | 111 | Individual templates may include other templates as partials. 112 | 113 | [ico-travis]: https://img.shields.io/travis/meanbee/docker-magento.svg?style=flat-square 114 | [ico-dockerbuild]: https://img.shields.io/docker/build/meanbee/magento.svg?style=flat-square 115 | [ico-downloads]: https://img.shields.io/docker/pulls/meanbee/magento.svg?style=flat-square 116 | [ico-dockerstars]: https://img.shields.io/docker/stars/meanbee/magento.svg?style=flat-square 117 | 118 | [link-travis]: https://travis-ci.org/meanbee/docker-magento 119 | [link-dockerhub]: https://hub.docker.com/r/meanbee/magento/ 120 | -------------------------------------------------------------------------------- /builder.php: -------------------------------------------------------------------------------- 1 | template_dir = $options["template_dir"] ?? static::DEFAULT_TEMPLATE_DIR; 54 | $this->destination_dir = $options["destination_dir"] ?? static::DEFAULT_DESTINATION_DIR; 55 | $this->executable_permissions = $options["executable_file_permissions"] ?? static::DEFAULT_EXECUTABLE_PERMISSIONS; 56 | $this->verbose_level = $options["verbose"] ?? static::DEFAULT_VERBOSE_LEVEL; 57 | 58 | $this->loadConfig($options["config_file"] ?? static::DEFAULT_CONFIG_FILE); 59 | } 60 | 61 | /** 62 | * Build the files described in the loaded config. 63 | */ 64 | public function run() 65 | { 66 | foreach ($this->build_config as $name => $config) { 67 | $this->verbose(sprintf("Building '%s'...", $name), 1); 68 | foreach ($config["files"] as $file_name => $variables) { 69 | $destination_file = $this->getDestinationFile($file_name, $config); 70 | $contents = ""; 71 | 72 | if ($template_file = $this->getTemplateFile($file_name, $config)) { 73 | // Merge global variables to the template variables 74 | $variables["version"] = $config["version"]; 75 | $variables["flavour"] = $config["flavour"]; 76 | 77 | $contents = $this->renderTemplate($template_file, $variables); 78 | } 79 | 80 | $this->verbose(sprintf("\tWriting '%s'...", $destination_file), 2); 81 | $this->writeFile($destination_file, $contents); 82 | 83 | if ($variables["executable"] ?? false) { 84 | $this->verbose(sprintf("\tUpdating permissions on '%s' to '%o'...", $destination_file, $this->executable_permissions), 2); 85 | $this->setFilePermissions($destination_file, $this->executable_permissions); 86 | } 87 | } 88 | } 89 | } 90 | 91 | /** 92 | * Load the build configuration from the given file. 93 | * 94 | * @param string $file 95 | * 96 | * @return $this 97 | * @throws Exception 98 | */ 99 | protected function loadConfig($file) 100 | { 101 | $config = json_decode(file_get_contents($file), true); 102 | 103 | if (!is_array($config)) { 104 | throw new Exception(sprintf("Invalid configuration in %s!", $file)); 105 | } 106 | 107 | $this->build_config = $config; 108 | 109 | return $this; 110 | } 111 | 112 | /** 113 | * Return the template file name for the given file. 114 | * 115 | * @param string $file_name 116 | * @param array $config 117 | * 118 | * @return null|string 119 | */ 120 | protected function getTemplateFile($file_name, $config) 121 | { 122 | $file_names = [ 123 | sprintf("%s-%s-%s", $file_name, $config["version"], $config["flavour"]), 124 | sprintf("%s-%s", $file_name, $config["version"]), 125 | sprintf("%s-%s", $file_name, $config["flavour"]), 126 | $file_name, 127 | ]; 128 | 129 | foreach ($file_names as $file_name) { 130 | $path = $this->template_dir . DIRECTORY_SEPARATOR . $file_name; 131 | 132 | if (file_exists($path) && is_readable($path)) { 133 | return $path; 134 | } 135 | } 136 | 137 | return null; 138 | } 139 | 140 | /** 141 | * Get the destination for the given file. 142 | * 143 | * @param string $file_name 144 | * @param array $config 145 | * 146 | * @return string 147 | */ 148 | protected function getDestinationFile($file_name, $config) 149 | { 150 | return implode(DIRECTORY_SEPARATOR, [ 151 | $this->destination_dir, 152 | $config["version"], 153 | $config["flavour"], 154 | $file_name, 155 | ]); 156 | } 157 | 158 | /** 159 | * Render the given template file using the provided variables and return the resulting output. 160 | * 161 | * @param string $template_file 162 | * @param array $variables 163 | * 164 | * @return string 165 | */ 166 | protected function renderTemplate($template_file, $variables) 167 | { 168 | extract($variables); 169 | ob_start(); 170 | 171 | include $template_file; 172 | 173 | $output = ob_get_clean(); 174 | 175 | return $output ?: ""; 176 | } 177 | 178 | /** 179 | * Write the contents to the given file. 180 | * 181 | * @param string $file_name 182 | * @param string $contents 183 | * 184 | * @return $this 185 | * @throws Exception 186 | */ 187 | protected function writeFile($file_name, $contents) 188 | { 189 | $directory = dirname($file_name); 190 | 191 | if (!is_dir($directory)) { 192 | mkdir($directory, 0755, true); 193 | } 194 | 195 | if (file_put_contents($file_name, $contents) === false) { 196 | throw new Exception(sprintf("Failed to write %s!", $file_name)); 197 | } 198 | 199 | return $this; 200 | } 201 | 202 | /** 203 | * Update the permissions on the given file. 204 | * 205 | * @param string $file_name 206 | * @param int $permissions 207 | * 208 | * @return $this 209 | */ 210 | protected function setFilePermissions($file_name, $permissions = 0644) 211 | { 212 | chmod($file_name, $permissions); 213 | 214 | return $this; 215 | } 216 | 217 | /** 218 | * Print an informational message to the command line. 219 | * 220 | * @param string $message 221 | * @param int $level 222 | * @param bool $newline 223 | * 224 | * @return $this 225 | */ 226 | protected function verbose($message, $level = 1, $newline = true) 227 | { 228 | if ($level <= $this->verbose_level) { 229 | printf("%s%s", $message, $newline ? PHP_EOL : ""); 230 | } 231 | 232 | return $this; 233 | } 234 | } 235 | 236 | /** 237 | * __MAIN__ 238 | */ 239 | 240 | $args = getopt("hvq"); 241 | $options = []; 242 | 243 | if (isset($args["h"])) { 244 | echo <<run(); 263 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "5.5-apache": { 3 | "version": "5.5", 4 | "flavour": "apache", 5 | "files": { 6 | "Dockerfile": { 7 | "php_ext_acpu_version": "4.0.11", 8 | "php_ext_memcached_version": "2.2.0", 9 | "php_ext_ioncube_version": "5.5", 10 | "php_ext_xdebug_version": "2.5.5" 11 | }, 12 | "entrypoint.sh": { 13 | "executable": true 14 | }, 15 | "magento.conf": {}, 16 | "php.ini": {} 17 | } 18 | }, 19 | "5.5-cli": { 20 | "version": "5.5", 21 | "flavour": "cli", 22 | "files": { 23 | "Dockerfile": { 24 | "php_ext_acpu_version": "4.0.11", 25 | "php_ext_memcached_version": "2.2.0", 26 | "php_ext_ioncube_version": "5.5", 27 | "php_ext_xdebug_version": "2.5.5", 28 | "mysql_client_package": "mysql-client" 29 | }, 30 | "bin/magerun": { 31 | "executable": true 32 | }, 33 | "bin/magedbm": { 34 | "executable": true 35 | }, 36 | "bin/magemm": { 37 | "executable": true 38 | }, 39 | "entrypoint.sh": { 40 | "include_cron": true, 41 | "executable": true 42 | }, 43 | "php.ini": {}, 44 | "run-cron.sh": { 45 | "executable": true 46 | } 47 | } 48 | }, 49 | "5.5-fpm": { 50 | "version": "5.5", 51 | "flavour": "fpm", 52 | "files": { 53 | "Dockerfile": { 54 | "php_ext_acpu_version": "4.0.11", 55 | "php_ext_memcached_version": "2.2.0", 56 | "php_ext_ioncube_version": "5.5", 57 | "php_ext_xdebug_version": "2.5.5" 58 | }, 59 | "entrypoint.sh": { 60 | "executable": true 61 | }, 62 | "php.ini": {} 63 | } 64 | }, 65 | "5.6-apache": { 66 | "version": "5.6", 67 | "flavour": "apache", 68 | "files": { 69 | "Dockerfile": { 70 | "php_ext_acpu_version": "4.0.11", 71 | "php_ext_memcached_version": "2.2.0", 72 | "php_ext_ioncube_version": "5.6", 73 | "php_ext_xdebug_version": "2.5.5" 74 | }, 75 | "entrypoint.sh": { 76 | "executable": true 77 | }, 78 | "magento.conf": {}, 79 | "php.ini": {} 80 | } 81 | }, 82 | "5.6-cli": { 83 | "version": "5.6", 84 | "flavour": "cli", 85 | "files": { 86 | "Dockerfile": { 87 | "php_ext_acpu_version": "4.0.11", 88 | "php_ext_memcached_version": "2.2.0", 89 | "php_ext_ioncube_version": "5.6", 90 | "php_ext_xdebug_version": "2.5.5", 91 | "mysql_client_package": "mysql-client" 92 | }, 93 | "bin/magerun": { 94 | "executable": true 95 | }, 96 | "bin/magedbm": { 97 | "executable": true 98 | }, 99 | "bin/magemm": { 100 | "executable": true 101 | }, 102 | "entrypoint.sh": { 103 | "include_cron": true, 104 | "executable": true 105 | }, 106 | "php.ini": {}, 107 | "run-cron.sh": { 108 | "executable": true 109 | } 110 | } 111 | }, 112 | "5.6-fpm": { 113 | "version": "5.6", 114 | "flavour": "fpm", 115 | "files": { 116 | "Dockerfile": { 117 | "php_ext_acpu_version": "4.0.11", 118 | "php_ext_memcached_version": "2.2.0", 119 | "php_ext_ioncube_version": "5.6", 120 | "php_ext_xdebug_version": "2.5.5" 121 | }, 122 | "entrypoint.sh": { 123 | "executable": true 124 | }, 125 | "php.ini": {} 126 | } 127 | }, 128 | "7.0-apache": { 129 | "version": "7.0", 130 | "flavour": "apache", 131 | "files": { 132 | "Dockerfile": { 133 | "php_ext_acpu_version": "5.1.7", 134 | "php_ext_memcached_version": "3.0.3", 135 | "php_ext_ioncube_version": "7.0", 136 | "php_ext_xdebug_version": "2.6.1" 137 | }, 138 | "entrypoint.sh": { 139 | "executable": true 140 | }, 141 | "magento.conf": {}, 142 | "php.ini": {} 143 | } 144 | }, 145 | "7.0-cli": { 146 | "version": "7.0", 147 | "flavour": "cli", 148 | "files": { 149 | "Dockerfile": { 150 | "php_ext_acpu_version": "5.1.7", 151 | "php_ext_memcached_version": "3.0.3", 152 | "php_ext_ioncube_version": "7.0", 153 | "php_ext_xdebug_version": "2.6.1", 154 | "mysql_client_package": "mysql-client" 155 | }, 156 | "bin/magerun": { 157 | "executable": true 158 | }, 159 | "bin/magedbm": { 160 | "executable": true 161 | }, 162 | "bin/magemm": { 163 | "executable": true 164 | }, 165 | "entrypoint.sh": { 166 | "include_cron": true, 167 | "executable": true 168 | }, 169 | "php.ini": {}, 170 | "run-cron.sh": { 171 | "executable": true 172 | } 173 | } 174 | }, 175 | "7.0-fpm": { 176 | "version": "7.0", 177 | "flavour": "fpm", 178 | "files": { 179 | "Dockerfile": { 180 | "php_ext_acpu_version": "5.1.7", 181 | "php_ext_memcached_version": "3.0.3", 182 | "php_ext_ioncube_version": "7.0", 183 | "php_ext_xdebug_version": "2.6.1" 184 | }, 185 | "entrypoint.sh": { 186 | "executable": true 187 | }, 188 | "php.ini": {} 189 | } 190 | }, 191 | "7.1-apache": { 192 | "version": "7.1", 193 | "flavour": "apache", 194 | "files": { 195 | "Dockerfile": { 196 | "php_ext_acpu_version": "5.1.7", 197 | "php_ext_memcached_version": "3.0.3", 198 | "php_ext_ioncube_version": "7.1", 199 | "php_ext_xdebug_version": "2.6.1" 200 | }, 201 | "entrypoint.sh": { 202 | "executable": true 203 | }, 204 | "magento.conf": {}, 205 | "php.ini": {} 206 | } 207 | }, 208 | "7.1-cli": { 209 | "version": "7.1", 210 | "flavour": "cli", 211 | "files": { 212 | "Dockerfile": { 213 | "php_ext_acpu_version": "5.1.7", 214 | "php_ext_memcached_version": "3.0.3", 215 | "php_ext_ioncube_version": "7.1", 216 | "php_ext_xdebug_version": "2.6.1", 217 | "mysql_client_package": "default-mysql-client" 218 | }, 219 | "bin/magerun": { 220 | "executable": true 221 | }, 222 | "bin/magedbm": { 223 | "executable": true 224 | }, 225 | "bin/magemm": { 226 | "executable": true 227 | }, 228 | "entrypoint.sh": { 229 | "include_cron": true, 230 | "executable": true 231 | }, 232 | "php.ini": {}, 233 | "run-cron.sh": { 234 | "executable": true 235 | } 236 | } 237 | }, 238 | "7.1-fpm": { 239 | "version": "7.1", 240 | "flavour": "fpm", 241 | "files": { 242 | "Dockerfile": { 243 | "php_ext_acpu_version": "5.1.7", 244 | "php_ext_memcached_version": "3.0.3", 245 | "php_ext_ioncube_version": "7.1", 246 | "php_ext_xdebug_version": "2.6.1" 247 | }, 248 | "entrypoint.sh": { 249 | "executable": true 250 | }, 251 | "php.ini": {} 252 | } 253 | }, 254 | "7.2-apache": { 255 | "version": "7.2", 256 | "flavour": "apache", 257 | "files": { 258 | "Dockerfile": { 259 | "php_ext_acpu_version": "5.1.12", 260 | "php_ext_memcached_version": "3.0.4", 261 | "php_ext_ioncube_version": "7.2", 262 | "php_ext_xdebug_version": "2.6.1" 263 | }, 264 | "entrypoint.sh": { 265 | "executable": true 266 | }, 267 | "magento.conf": {}, 268 | "php.ini": {} 269 | } 270 | }, 271 | "7.2-cli": { 272 | "version": "7.2", 273 | "flavour": "cli", 274 | "files": { 275 | "Dockerfile": { 276 | "php_ext_acpu_version": "5.1.12", 277 | "php_ext_memcached_version": "3.0.4", 278 | "php_ext_ioncube_version": "7.2", 279 | "php_ext_xdebug_version": "2.6.1", 280 | "mysql_client_package": "default-mysql-client" 281 | }, 282 | "bin/magerun": { 283 | "executable": true 284 | }, 285 | "bin/magedbm": { 286 | "executable": true 287 | }, 288 | "bin/magemm": { 289 | "executable": true 290 | }, 291 | "entrypoint.sh": { 292 | "include_cron": true, 293 | "executable": true 294 | }, 295 | "php.ini": {}, 296 | "run-cron.sh": { 297 | "executable": true 298 | } 299 | } 300 | }, 301 | "7.2-fpm": { 302 | "version": "7.2", 303 | "flavour": "fpm", 304 | "files": { 305 | "Dockerfile": { 306 | "php_ext_acpu_version": "5.1.12", 307 | "php_ext_memcached_version": "3.0.4", 308 | "php_ext_ioncube_version": "7.2", 309 | "php_ext_xdebug_version": "2.6.1" 310 | }, 311 | "entrypoint.sh": { 312 | "executable": true 313 | }, 314 | "php.ini": {} 315 | } 316 | }, 317 | "7.3-apache": { 318 | "version": "7.3", 319 | "flavour": "apache", 320 | "files": { 321 | "Dockerfile": { 322 | "php_ext_acpu_version": "5.1.18", 323 | "php_ext_memcached_version": "3.1.5", 324 | "php_ext_ioncube_version": "7.3", 325 | "php_ext_xdebug_version": "2.9.0" 326 | }, 327 | "entrypoint.sh": { 328 | "executable": true 329 | }, 330 | "magento.conf": {}, 331 | "php.ini": {} 332 | } 333 | }, 334 | "7.3-cli": { 335 | "version": "7.3", 336 | "flavour": "cli", 337 | "files": { 338 | "Dockerfile": { 339 | "php_ext_acpu_version": "5.1.18", 340 | "php_ext_memcached_version": "3.1.5", 341 | "php_ext_ioncube_version": "7.3", 342 | "php_ext_xdebug_version": "2.9.0", 343 | "mysql_client_package": "default-mysql-client" 344 | }, 345 | "bin/magerun": { 346 | "executable": true 347 | }, 348 | "bin/magedbm": { 349 | "executable": true 350 | }, 351 | "bin/magemm": { 352 | "executable": true 353 | }, 354 | "entrypoint.sh": { 355 | "include_cron": true, 356 | "executable": true 357 | }, 358 | "php.ini": {}, 359 | "run-cron.sh": { 360 | "executable": true 361 | } 362 | } 363 | }, 364 | "7.3-fpm": { 365 | "version": "7.3", 366 | "flavour": "fpm", 367 | "files": { 368 | "Dockerfile": { 369 | "php_ext_acpu_version": "5.1.18", 370 | "php_ext_memcached_version": "3.1.5", 371 | "php_ext_ioncube_version": "7.3", 372 | "php_ext_xdebug_version": "2.9.0" 373 | }, 374 | "entrypoint.sh": { 375 | "executable": true 376 | }, 377 | "php.ini": {} 378 | } 379 | }, 380 | "7.4-apache": { 381 | "version": "7.4", 382 | "flavour": "apache", 383 | "files": { 384 | "Dockerfile": { 385 | "php_ext_acpu_version": "5.1.18", 386 | "php_ext_memcached_version": "3.1.5", 387 | "php_ext_xdebug_version": "2.9.0" 388 | }, 389 | "entrypoint.sh": { 390 | "executable": true 391 | }, 392 | "magento.conf": {}, 393 | "php.ini": {} 394 | } 395 | }, 396 | "7.4-cli": { 397 | "version": "7.4", 398 | "flavour": "cli", 399 | "files": { 400 | "Dockerfile": { 401 | "php_ext_acpu_version": "5.1.18", 402 | "php_ext_memcached_version": "3.1.5", 403 | "php_ext_xdebug_version": "2.9.0", 404 | "mysql_client_package": "default-mysql-client" 405 | }, 406 | "bin/magerun": { 407 | "executable": true 408 | }, 409 | "bin/magedbm": { 410 | "executable": true 411 | }, 412 | "bin/magemm": { 413 | "executable": true 414 | }, 415 | "entrypoint.sh": { 416 | "include_cron": true, 417 | "executable": true 418 | }, 419 | "php.ini": {}, 420 | "run-cron.sh": { 421 | "executable": true 422 | } 423 | } 424 | }, 425 | "7.4-fpm": { 426 | "version": "7.4", 427 | "flavour": "fpm", 428 | "files": { 429 | "Dockerfile": { 430 | "php_ext_acpu_version": "5.1.18", 431 | "php_ext_memcached_version": "3.1.5", 432 | "php_ext_xdebug_version": "2.9.0" 433 | }, 434 | "entrypoint.sh": { 435 | "executable": true 436 | }, 437 | "php.ini": {} 438 | } 439 | } 440 | } 441 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | services: 3 | web: 4 | image: meanbee/magento:5.6-apache 5 | hostname: magento-dev.docker 6 | ports: 7 | - 80 8 | volumes_from: 9 | - appdata 10 | environment: 11 | - VIRTUAL_HOST=magento-dev.docker 12 | - VIRTUAL_PORT=80 13 | - HTTPS_METHOD=noredirect 14 | - ENABLE_SENDMAIL=true 15 | links: 16 | - db 17 | 18 | cron: 19 | image: meanbee/magento:5.6-cli 20 | hostname: cron.magento-dev.docker 21 | working_dir: /var/www/html 22 | command: /run-cron.sh 23 | volumes_from: 24 | - appdata 25 | environment: 26 | - ENABLE_SENDMAIL=true 27 | links: 28 | - db 29 | 30 | cli: 31 | image: meanbee/magento:5.6-cli 32 | hostname: cli.magento-dev.docker 33 | working_dir: /var/www/html 34 | command: /bin/true 35 | volumes_from: 36 | - appdata 37 | environment: 38 | - AWS_ACCESS_KEY_ID=00000000000000000000 39 | - AWS_SECRET_ACCESS_KEY=0000000000000000000000000000000000000000 40 | - AWS_REGION=eu-west-1 41 | - AWS_BUCKET=magedbm 42 | - AWS_MEDIA_BUCKET=magemm 43 | links: 44 | - db 45 | 46 | db: 47 | image: meanbee/magento-mysql 48 | ports: 49 | - 3306 50 | environment: 51 | - MYSQL_ROOT_PASSWORD=toor 52 | - MYSQL_USER=magento 53 | - MYSQL_PASSWORD=magento 54 | - MYSQL_DATABASE=magento 55 | 56 | appdata: 57 | image: tianon/true 58 | volumes: 59 | - .:/var/www/html 60 | -------------------------------------------------------------------------------- /src/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM 2 | 3 | MAINTAINER Tomas Gerulaitis 4 | 5 | ENV PHP_EXT_APCU_VERSION "" 6 | ENV PHP_EXT_MEMCACHED_VERSION "" 7 | ENV PHP_EXT_XDEBUG_VERSION "" 8 | 9 | 10 | 11 | =') ?> 12 | =') ?> 13 | 14 | 15 | 16 | 17 | 18 | RUN build_packages="" \ 19 | && apt-get update && apt-get install -y $build_packages \ 20 | && yes "" | pecl install apcu-$PHP_EXT_APCU_VERSION && docker-php-ext-enable apcu \ 21 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/--with-freetype --with-jpeg \ 22 | && docker-php-ext-install gd \ 23 | && docker-php-ext-install mbstring \ 24 | 25 | && docker-php-ext-install mcrypt \ 26 | 27 | && echo "no" | pecl install memcached-$PHP_EXT_MEMCACHED_VERSION && docker-php-ext-enable memcached \ 28 | && docker-php-ext-install pcntl \ 29 | && docker-php-ext-install pdo_mysql \ 30 | && docker-php-ext-install soap \ 31 | && yes | pecl install xdebug-$PHP_EXT_XDEBUG_VERSION && docker-php-ext-enable xdebug \ 32 | && docker-php-ext-install xsl \ 33 | && docker-php-ext-install zip \ 34 | && docker-php-ext-install intl \ 35 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 36 | 37 | 38 | ENV ION_CUBE_PHP_VERSION "" 39 | RUN PHP_EXTENSION_DIR="$(php-config --extension-dir)" bash -c 'curl http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o /ioncube_loaders_lin_x86-64.tar.gz && \ 40 | tar -xzvf /ioncube_loaders_lin_x86-64.tar.gz -C / && \ 41 | cp "/ioncube/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" $PHP_EXTENSION_DIR && \ 42 | echo "zend_extension=${PHP_EXTENSION_DIR}/ioncube_loader_lin_${ION_CUBE_PHP_VERSION}.so" > /usr/local/etc/php/conf.d/00-ioncube.ini && \ 43 | rm -rf /ioncube /ioncube_loaders_lin_x86-64.tar.gz' 44 | 45 | 46 | COPY php.ini /usr/local/etc/php/conf.d/zz-magento.ini 47 | 48 | ADD entrypoint.sh /entrypoint.sh 49 | ENTRYPOINT ["/entrypoint.sh"] 50 | -------------------------------------------------------------------------------- /src/Dockerfile-apache: -------------------------------------------------------------------------------- 1 | 2 | 3 | RUN a2enmod rewrite headers 4 | 5 | COPY magento.conf /etc/apache2/conf-enabled/ 6 | 7 | CMD ["apache2-foreground"] 8 | -------------------------------------------------------------------------------- /src/Dockerfile-cli: -------------------------------------------------------------------------------- 1 | 2 | 3 | ENV BIN_DIR "/usr/local/bin" 4 | RUN apt-get update \ 5 | && apt-get install -y cron git groff python-pip rsyslog sudo \ 6 | && sed -i '/imklog/s/^/#/' /etc/rsyslog.conf \ 7 | && pip install awscli \ 8 | && curl --retry 10 --retry-delay 3 https://getcomposer.org/installer | php -- --install-dir=$BIN_DIR --filename=composer \ 9 | && curl --retry 10 --retry-delay 3 -L https://github.com/punkstar/mageconfigsync/releases/download/0.4.0/mageconfigsync-0.4.0.phar -o $BIN_DIR/mageconfigsync && chmod +x $BIN_DIR/mageconfigsync \ 10 | && curl --retry 10 --retry-delay 3 -L https://github.com/meanbee/magedbm/releases/download/v1.6.0/magedbm.phar -o $BIN_DIR/magedbm.phar && chmod +x $BIN_DIR/magedbm.phar \ 11 | && curl --retry 10 --retry-delay 3 https://files.magerun.net/n98-magerun.phar -o $BIN_DIR/n98-magerun.phar && chmod +x $BIN_DIR/n98-magerun.phar \ 12 | && curl --retry 10 --retry-delay 3 https://raw.githubusercontent.com/colinmollenhour/modman/master/modman -o $BIN_DIR/modman && chmod +x $BIN_DIR/modman \ 13 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 14 | 15 | COPY bin/* $BIN_DIR/ 16 | ADD run-cron.sh /run-cron.sh 17 | 18 | CMD ["php", "-a"] 19 | -------------------------------------------------------------------------------- /src/Dockerfile-fpm: -------------------------------------------------------------------------------- 1 | 2 | 3 | CMD ["php-fpm"] 4 | -------------------------------------------------------------------------------- /src/bin/magedbm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | magedbm.phar configure \ 4 | --key="$AWS_ACCESS_KEY_ID" \ 5 | --secret="$AWS_SECRET_ACCESS_KEY" \ 6 | --region="$AWS_REGION" \ 7 | --bucket="$AWS_BUCKET" 8 | 9 | exec magedbm.phar "$@" 10 | -------------------------------------------------------------------------------- /src/bin/magemm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # magemm - sync media images from S3 4 | # 5 | 6 | set -e # Exit on error 7 | 8 | # Parameters 9 | ############################# 10 | 11 | project=$1 12 | destination=$(pwd)/media/ 13 | 14 | # Usage 15 | ############################# 16 | 17 | [ "$project" = "-h" -o "$project" = "--help" ] \ 18 | && cat << USAGE && exit 0 19 | Usage: $0 project-name 20 | 21 | Sync the media images from S3 into $destination 22 | USAGE 23 | 24 | # Validation 25 | ############################# 26 | 27 | [ -z "$project" ] \ 28 | && echo "project-name parameter required!" \ 29 | && exit 1 30 | 31 | [ -z "$AWS_ACCESS_KEY_ID" -o -z "$AWS_SECRET_ACCESS_KEY" -o -z "$AWS_REGION" -o -z "$AWS_MEDIA_BUCKET" ] \ 32 | && echo '$AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY, $AWS_REGION and $AWS_MEDIA_BUCKET environment variables required!' \ 33 | && exit 1 34 | 35 | # Main 36 | ############################# 37 | 38 | aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID 39 | aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY 40 | aws configure set default.region $AWS_REGION 41 | 42 | exec aws s3 sync --delete s3://$AWS_MEDIA_BUCKET/$project/media/ $destination 43 | -------------------------------------------------------------------------------- /src/bin/magerun: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exec sudo -u www-data -- n98-magerun.phar "$@" 4 | -------------------------------------------------------------------------------- /src/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ "$DEBUG" = "true" ] && set -x 4 | 5 | 6 | CRON_LOG=/var/log/cron.log 7 | 8 | # Setup Magento cron 9 | echo "* * * * * root su www-data -s /bin/bash -c 'sh $(pwd)/cron.sh'" > /etc/cron.d/magento 10 | 11 | # Get rsyslog running for cron output 12 | touch $CRON_LOG 13 | echo "cron.* $CRON_LOG" > /etc/rsyslog.d/cron.conf 14 | service rsyslog start 15 | 16 | 17 | # Configure Sendmail if required 18 | if [ "$ENABLE_SENDMAIL" == "true" ]; then 19 | /etc/init.d/sendmail start 20 | fi 21 | 22 | # Configure Xdebug 23 | if [ "$XDEBUG_CONFIG" ]; then 24 | echo "" > /usr/local/etc/php/conf.d/zz-xdebug.ini 25 | for config in $XDEBUG_CONFIG; do 26 | echo "xdebug.$config" >> /usr/local/etc/php/conf.d/zz-xdebug.ini 27 | done 28 | fi 29 | 30 | # Execute the supplied command 31 | exec "$@" 32 | -------------------------------------------------------------------------------- /src/magento.conf: -------------------------------------------------------------------------------- 1 | # Enable support for SSL termination 2 | SetEnvIf X-Forwarded-Proto https HTTPS=on 3 | -------------------------------------------------------------------------------- /src/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=UTC 3 | 4 | ; Magento recommended settings 5 | memory_limit=512M 6 | max_execution_time = 600 7 | 8 | ; Request size limits 9 | upload_max_filesize=256M 10 | post_max_size=256M 11 | 12 | ; Sendmail 13 | sendmail_path=/usr/sbin/sendmail -t -i 14 | 15 | ; Enable APC cache on command line for Magento cron 16 | apc.enable_cli=1 17 | -------------------------------------------------------------------------------- /src/run-cron.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cron && \ 4 | tail -f -n0 /var/log/cron.log 5 | -------------------------------------------------------------------------------- /test-runner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ################################################################################ 4 | # Ensure our environment variables are set 5 | ################################################################################ 6 | if [ "$PHP_VERSION" == "" ]; then 7 | echo "You must define a \$PHP_VERSION environment variable" 8 | exit 1 9 | fi 10 | 11 | if [ "$IMAGE_FLAVOUR" == "" ]; then 12 | echo "You must define a \$IMAGE_FLAVOUR environment variable" 13 | exit 1 14 | fi 15 | 16 | if [ "$DOCKER_IP" == "" ]; then 17 | if [ "$DOCKER_MACHINE_NAME" == "dinghy" ]; then 18 | DOCKER_IP="$(dinghy ip)" 19 | else 20 | DOCKER_IP="127.0.0.1" 21 | fi 22 | fi 23 | 24 | ################################################################################ 25 | # Set our variables 26 | ################################################################################ 27 | IMAGE_NAME="test-$PHP_VERSION-$IMAGE_FLAVOUR" 28 | TEST_DIR="$(pwd)/test" 29 | TEST_OK_STRING="TEST OK" 30 | TEST_PORT="8888" 31 | 32 | ################################################################################ 33 | # Kick off with some debug 34 | ################################################################################ 35 | echo "" 36 | echo "Test Runner Configuration:" 37 | echo "" 38 | echo "PHP Version: $PHP_VERSION" 39 | echo "Image Flavour: $IMAGE_FLAVOUR" 40 | 41 | ################################################################################ 42 | # Pull published image down so we can try and reuse layers 43 | ################################################################################ 44 | echo "" 45 | echo "Pulling published images for layer cache.." 46 | echo "" 47 | docker pull meanbee/magento:${PHP_VERSION}-${IMAGE_FLAVOUR} 48 | 49 | ################################################################################ 50 | # Build our images 51 | ################################################################################ 52 | echo "" 53 | echo "Building image.." 54 | echo "" 55 | cd $PHP_VERSION/$IMAGE_FLAVOUR && docker build -t $IMAGE_NAME . || exit 1 56 | cd ../.. 57 | 58 | ################################################################################ 59 | # Output the PHP version running in the image 60 | ################################################################################ 61 | echo "" 62 | echo "Image PHP Version:" 63 | echo "" 64 | docker run --rm -h test.host $IMAGE_NAME php --version || exit 1 65 | 66 | ################################################################################ 67 | # Run CLI tests on all images 68 | ################################################################################ 69 | echo "" 70 | echo "Running cli tests:" 71 | echo "" 72 | 73 | docker run --rm -h test.host --volume $TEST_DIR:/test $IMAGE_NAME php /test/test.php | tee /tmp/test.log 74 | grep "$TEST_OK_STRING" /tmp/test.log > /dev/null || exit 1 75 | rm -f /tmp/test.log 76 | 77 | ################################################################################ 78 | # Run web server tests on apache image 79 | ################################################################################ 80 | if [ "$IMAGE_FLAVOUR" == "apache" ]; then 81 | echo "" 82 | echo "Running web server tests:" 83 | echo "" 84 | 85 | # Start the web server 86 | docker run -h test.host -d --volume $TEST_DIR:/var/www/html -p $TEST_PORT:80 $IMAGE_NAME > /tmp/$IMAGE_NAME.cid || exit 1 87 | echo "" 88 | 89 | # Spent up to a minute trying to connect to the web server 90 | max_attempts=12 91 | timeout=5 92 | attempt=0 93 | 94 | while (( $attempt < $max_attempts )) 95 | do 96 | curl $DOCKER_IP:$TEST_PORT/test.php | tee /tmp/test.log 97 | grep "$TEST_OK_STRING" /tmp/test.log > /dev/null 98 | curl_result=$? 99 | 100 | rm -f /tmp/test.log 101 | 102 | # Wait for a zero exit code before stopping 103 | if [[ $curl_result == 0 ]] 104 | then 105 | break 106 | fi 107 | 108 | echo "" 109 | echo "Failed to connect to web server. Retrying in $timeout.." 110 | echo "" 111 | 112 | sleep $timeout 113 | attempt=$(( attempt + 1 )) 114 | done 115 | 116 | # Stop the web server 117 | cat /tmp/$IMAGE_NAME.cid | xargs docker rm -f && rm /tmp/$IMAGE_NAME.cid 118 | 119 | if [ "$attempt" -eq "$max_attempts" ]; then 120 | echo "" 121 | echo "Reached maximum web server connnection attempts" 122 | echo "" 123 | exit 1 124 | fi 125 | fi 126 | -------------------------------------------------------------------------------- /test/test.php: -------------------------------------------------------------------------------- 1 | errorCount++; 13 | } 14 | 15 | public function info($message) { 16 | printf("[INFO] %s\n", $message); 17 | } 18 | 19 | public function isOk() { 20 | return $this->errorCount == 0; 21 | } 22 | } 23 | 24 | $checker = new Checker(); 25 | 26 | // Output PHP Version 27 | $checker->info(sprintf("PHP Version: %s", phpversion())); 28 | 29 | // Check required extensions 30 | $required_extensions = array( 31 | 'curl', 32 | 'dom', 33 | 'gd', 34 | 'hash', 35 | 'iconv', 36 | 'memcached', 37 | 'pcre', 38 | 'pdo', 39 | 'pdo_mysql', 40 | 'simplexml', 41 | 'xsl', 42 | 'xdebug', 43 | 'IonCube Loader', 44 | 'zip', 45 | 'intl' 46 | ); 47 | 48 | if (version_compare(phpversion(), '7.2', '<')) { 49 | $required_extensions[] = 'mcrypt'; 50 | } 51 | 52 | foreach ($required_extensions as $extension) { 53 | if (!extension_loaded($extension)) { 54 | $checker->error(sprintf("Extension '%s' is not loaded", $extension)); 55 | } else { 56 | $checker->info(sprintf("Extension '%s' is loaded OK", $extension)); 57 | } 58 | } 59 | 60 | // Output result 61 | if ($checker->isOK()) { 62 | printf("\nTEST OK\n"); 63 | } else { 64 | printf("\nTEST NOT OK\n"); 65 | } 66 | --------------------------------------------------------------------------------