|
| 1 | +FROM php:7.1-apache |
| 2 | +# install the PHP extensions we need |
| 3 | +RUN set -ex; \ |
| 4 | + \ |
| 5 | + apt-get update; \ |
| 6 | + apt-get install -y \ |
| 7 | + libjpeg-dev \ |
| 8 | + libpng-dev \ |
| 9 | + ; \ |
| 10 | + rm -rf /var/lib/apt/lists/*; \ |
| 11 | + \ |
| 12 | + docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \ |
| 13 | + docker-php-ext-install gd mysqli opcache |
| 14 | + |
| 15 | +RUN echo 'installing WP-CLI'; \ |
| 16 | + curl -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ |
| 17 | + chmod +x /usr/local/bin/wp |
| 18 | +# TODO consider removing the *-dev deps and only keeping the necessary lib* packages |
| 19 | + |
| 20 | +# set recommended PHP.ini settings |
| 21 | +# see https://secure.php.net/manual/en/opcache.installation.php |
| 22 | +RUN { \ |
| 23 | + echo 'opcache.memory_consumption=128'; \ |
| 24 | + echo 'opcache.interned_strings_buffer=8'; \ |
| 25 | + echo 'opcache.max_accelerated_files=4000'; \ |
| 26 | + echo 'opcache.revalidate_freq=2'; \ |
| 27 | + echo 'opcache.fast_shutdown=1'; \ |
| 28 | + echo 'opcache.enable_cli=1'; \ |
| 29 | + } > /usr/local/etc/php/conf.d/opcache-recommended.ini |
| 30 | + |
| 31 | +RUN a2enmod rewrite expires |
| 32 | + |
| 33 | +COPY ./code/themes /var/www/html/wp-content/themes |
| 34 | +COPY ./code/plugins /var/www/html/wp-content/plugins |
| 35 | + |
| 36 | +VOLUME /var/www/html |
| 37 | + |
| 38 | +EXPOSE 80 |
| 39 | + |
| 40 | +ENV WORDPRESS_VERSION 4.9.1 |
| 41 | +ENV WORDPRESS_SHA1 5376cf41403ae26d51ca55c32666ef68b10e35a4 |
| 42 | + |
| 43 | +RUN set -ex; \ |
| 44 | + curl -o wordpress.tar.gz -fSL "https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz"; \ |
| 45 | + tar -xzf wordpress.tar.gz -C /usr/src/; \ |
| 46 | + rm wordpress.tar.gz; \ |
| 47 | + chown -R www-data:www-data /usr/src/wordpress |
| 48 | + |
| 49 | +COPY ./data/php/multisite.htaccess /usr/src/wordpress/multisite.htaccess |
| 50 | +COPY ./data/php/docker-entrypoint.sh /usr/local/bin/ |
| 51 | +RUN chmod +x /usr/local/bin/docker-entrypoint.sh |
| 52 | + |
| 53 | +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] |
| 54 | +CMD ["apache2-foreground"] |
0 commit comments