|
| 1 | +# Dockerfile for all builds. The FROM part is switched out. Built by build.sh. See README. First three lines are stripped. |
| 2 | +FROM php |
| 3 | +################################################################################## |
| 4 | + |
| 5 | +LABEL php_xdebug_version="3" |
| 6 | + |
| 7 | +# Some parts are based on https://hub.docker.com/r/alexcheng/magento2/dockerfile |
| 8 | + |
| 9 | +# PHP extensions and msmtp |
| 10 | +RUN requirements="msmtp libmcrypt-dev libwebp-dev libmcrypt4 libcurl3-dev libfreetype6 libjpeg62-turbo libjpeg62-turbo-dev libpng-dev libxpm-dev libfreetype6-dev libicu-dev libxslt1-dev unzip libbz2-dev libzip-dev openssh-client libonig-dev git ssh-askpass libssl-dev libyaml-dev" \ |
| 11 | + && apt-get update \ |
| 12 | + && apt-get install -y $requirements \ |
| 13 | + && docker-php-ext-install pdo_mysql \ |
| 14 | + && docker-php-ext-install mysqli \ |
| 15 | + && docker-php-ext-install soap \ |
| 16 | + && docker-php-ext-install xsl \ |
| 17 | + && docker-php-ext-install zip \ |
| 18 | + && docker-php-ext-install intl \ |
| 19 | + && docker-php-ext-install bcmath \ |
| 20 | + && docker-php-ext-install bz2 \ |
| 21 | + && docker-php-ext-install sockets \ |
| 22 | + && docker-php-ext-configure gd @@gd_requirements@@ \ |
| 23 | + && docker-php-ext-install gd \ |
| 24 | + && docker-php-ext-install exif \ |
| 25 | + && docker-php-ext-install opcache \ |
| 26 | + && docker-php-ext-install pcntl \ |
| 27 | + && requirementsToRemove="libmcrypt-dev libwebp-dev libcurl3-dev libpng-dev libfreetype6-dev libjpeg62-turbo-dev libxpm-dev libbz2-dev libzip-dev libonig-dev" \ |
| 28 | + && apt-get purge -y $requirementsToRemove \ |
| 29 | + && apt-get clean \ |
| 30 | + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 31 | + |
| 32 | +# Install xdebug (based on https://gist.github.com/chadrien/c90927ec2d160ffea9c4) |
| 33 | +RUN yes | pecl install xdebug |
| 34 | + |
| 35 | +# Install yaml |
| 36 | +RUN yes | pecl install yaml && echo "extension=yaml.so" > /usr/local/etc/php/conf.d/ext-yaml.ini |
| 37 | + |
| 38 | +# Riptide no longer enabled xdebug in it's image, for performance reasons. |
| 39 | +# Please mount |
| 40 | +# For Riptide < 0.6: The PHP commands/services in the Riptide Community Repository mount these settings already |
| 41 | +# For Riptide >= 0.6: Use the plugin riptide-plugin-php-xdebug to toggle Xdebug. |
| 42 | +# |
| 43 | +# Previously these were the settings for Xdebug: |
| 44 | +#&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ |
| 45 | +#&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \ |
| 46 | +#&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini |
| 47 | + |
| 48 | +# Composer 1 |
| 49 | +RUN curl -sS https://getcomposer.org/installer | php -- --1 \ |
| 50 | + && mv composer.phar /usr/local/bin/composer |
| 51 | + |
| 52 | +# Composer 2 |
| 53 | +RUN curl -sS https://getcomposer.org/installer | php \ |
| 54 | + && mv composer.phar /usr/local/bin/composer2 |
| 55 | + |
| 56 | +# wp-cli |
| 57 | +RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \ |
| 58 | + && chmod +x ./wp-cli.phar \ |
| 59 | + && mv ./wp-cli.phar /usr/local/bin/ \ |
| 60 | + && ln -s /usr/local/bin/wp-cli.phar /usr/local/bin/wp-cli \ |
| 61 | + && ln -s /usr/local/bin/wp-cli.phar /usr/local/bin/wp |
| 62 | + |
| 63 | +# Magerun |
| 64 | +RUN curl -O https://files.magerun.net/n98-magerun.phar \ |
| 65 | + && chmod +x ./n98-magerun.phar \ |
| 66 | + && mv ./n98-magerun.phar /usr/local/bin/ \ |
| 67 | + && ln -s /usr/local/bin/n98-magerun.phar /usr/local/bin/magerun \ |
| 68 | + && ln -s /usr/local/bin/n98-magerun.phar /usr/local/bin/mr |
| 69 | + |
| 70 | +# Magerun2 |
| 71 | +RUN curl -O https://files.magerun.net/n98-magerun2.phar \ |
| 72 | + && chmod +x ./n98-magerun2.phar \ |
| 73 | + && mv ./n98-magerun2.phar /usr/local/bin/ \ |
| 74 | + && ln -s /usr/local/bin/n98-magerun2.phar /usr/local/bin/mr2 \ |
| 75 | + && ln -s /usr/local/bin/n98-magerun2.phar /usr/local/bin/magerun2 |
| 76 | + |
| 77 | +## Symfony |
| 78 | +RUN curl -O https://get.symfony.com/cli/installer \ |
| 79 | + && chmod +x ./installer \ |
| 80 | + && ./installer --install-dir /usr/local/bin \ |
| 81 | + && rm ./installer |
| 82 | + |
| 83 | +# Additional settings |
| 84 | +# || true for non-apache variants |
| 85 | +RUN a2enmod rewrite || true \ |
| 86 | + && echo "memory_limit=-1" > /usr/local/etc/php/conf.d/memory-limit.ini \ |
| 87 | + && echo "sendmail_path = /usr/bin/msmtp -t" > /usr/local/etc/php/conf.d/sendmail.ini |
| 88 | + |
| 89 | +# PHP-FPM: |
| 90 | +# Since we use a template build, this get's executed in all images... could possibly |
| 91 | +# change that in the future |
| 92 | +RUN mkdir -p /usr/local/etc/php-fpm.d/ \ |
| 93 | + # Allow the FPM process to access the environment variables passed in |
| 94 | + && echo "clear_env = no" >> /usr/local/etc/php-fpm.d/www.conf \ |
| 95 | + # logging |
| 96 | + && echo "php_admin_flag[log_errors] = on" >> /usr/local/etc/php-fpm.d/www.conf |
| 97 | + |
| 98 | +# Make /src the root source directory |
| 99 | +RUN rm -rf /usr/src && ln -s /src /usr/src |
| 100 | +WORKDIR /src |
0 commit comments