diff --git a/Dockerfile b/Dockerfile index b7b87fd..8e3bd42 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,36 +1,30 @@ -FROM php:7.2-apache +FROM php:8.1-apache -# install the PHP extensions we need +# Install the PHP extensions we need RUN set -ex; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libjpeg-dev \ - libpng-dev \ - ; \ - \ - docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-install gd mysqli opcache; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - apt-mark manual $savedAptMark; \ - ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ - | awk '/=>/ { print $3 }' \ - | sort -u \ - | xargs -r dpkg-query -S \ - | cut -d: -f1 \ - | sort -u \ - | xargs -rt apt-mark manual; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - rm -rf /var/lib/apt/lists/* - -#install redis php extension -ENV PHPREDIS_VERSION=4.0.2 + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + libjpeg-dev \ + libpng-dev \ + libfreetype6-dev \ + ; \ + docker-php-ext-configure gd --with-jpeg --with-freetype; \ + docker-php-ext-install gd mysqli opcache; \ + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark; \ + ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \ + | awk '/=>/ { print $3 }' \ + | sort -u \ + | xargs -r dpkg-query -S \ + | cut -d: -f1 \ + | sort -u \ + | xargs -rt apt-mark manual; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + rm -rf /var/lib/apt/lists/* +# Install Redis PHP extension with a newer compatible version +ENV PHPREDIS_VERSION=5.3.4 RUN docker-php-source extract \ && curl -L -o /tmp/redis.tar.gz https://github.com/phpredis/phpredis/archive/$PHPREDIS_VERSION.tar.gz \ && tar xfz /tmp/redis.tar.gz \ @@ -39,31 +33,30 @@ RUN docker-php-source extract \ && docker-php-ext-install redis \ && docker-php-source delete -# set recommended PHP.ini settings -# see https://secure.php.net/manual/en/opcache.installation.php +# Set recommended PHP.ini settings RUN { \ - echo 'opcache.memory_consumption=128'; \ - echo 'opcache.interned_strings_buffer=8'; \ - echo 'opcache.max_accelerated_files=4000'; \ - echo 'opcache.revalidate_freq=2'; \ - echo 'opcache.fast_shutdown=1'; \ - echo 'opcache.enable_cli=1'; \ - } > /usr/local/etc/php/conf.d/opcache-recommended.ini + echo 'opcache.memory_consumption=128'; \ + echo 'opcache.interned_strings_buffer=8'; \ + echo 'opcache.max_accelerated_files=4000'; \ + echo 'opcache.revalidate_freq=2'; \ + echo 'opcache.fast_shutdown=1'; \ + echo 'opcache.enable_cli=1'; \ + } > /usr/local/etc/php/conf.d/opcache-recommended.ini RUN a2enmod rewrite expires VOLUME /var/www/html -ENV WORDPRESS_VERSION 4.9.6 -ENV WORDPRESS_SHA1 6992f19163e21720b5693bed71ffe1ab17a4533a +# Set up WordPress 6.4.3 +ENV WORDPRESS_VERSION 6.4.3 +ENV WORDPRESS_SHA1 ee3bc3a73ab3cfa535c46f111eb641b3467fa44e RUN set -ex; \ - curl -o wordpress.tar.gz -fSL "https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz"; \ - echo "$WORDPRESS_SHA1 *wordpress.tar.gz" | sha1sum -c -; \ -# upstream tarballs include ./wordpress/ so this gives us /usr/src/wordpress - tar -xzf wordpress.tar.gz -C /usr/src/; \ - rm wordpress.tar.gz; \ - chown -R www-data:www-data /usr/src/wordpress + curl -o wordpress.tar.gz -fSL "https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz"; \ + echo "$WORDPRESS_SHA1 *wordpress.tar.gz" | sha1sum -c -; \ + tar -xzf wordpress.tar.gz -C /usr/src/; \ + rm wordpress.tar.gz; \ + chown -R www-data:www-data /usr/src/wordpress COPY docker-entrypoint.sh /usr/local/bin/