From a13c184882d25d0de87b616937040d9f18a028ed Mon Sep 17 00:00:00 2001 From: Justin Frydman Date: Fri, 30 Aug 2024 09:56:23 -0600 Subject: [PATCH 1/8] Use a volume for php.ini, fix opcache in containers --- containers/slic/Dockerfile | 3 --- containers/slic/php.ini | 6 ++++++ containers/wordpress/Dockerfile | 2 -- containers/wordpress/php.ini | 6 ++++++ slic-stack.yml | 3 +++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/containers/slic/Dockerfile b/containers/slic/Dockerfile index 6ccbca6..bee8fe5 100644 --- a/containers/slic/Dockerfile +++ b/containers/slic/Dockerfile @@ -40,9 +40,6 @@ RUN apt-get update && apt-get upgrade -yqq && apt-get install -yqq --no-install- # Configure the uopz extension. COPY ./docker-php-ext-uopz.ini /usr/local/etc/php/conf.d/docker-php-ext-uopz.ini -# Use our own ini configuration file to set up some PHP default. -COPY ./php.ini /usr/local/etc/php/conf.d/999-slic.ini - # Add the XDebug control scripts. COPY ./xdebug-on.sh /usr/local/bin/xdebug-on COPY ./xdebug-off.sh /usr/local/bin/xdebug-off diff --git a/containers/slic/php.ini b/containers/slic/php.ini index 85ac348..ddd794e 100644 --- a/containers/slic/php.ini +++ b/containers/slic/php.ini @@ -20,3 +20,9 @@ xdebug.start_with_request=yes xdebug.mode=develop,debug,coverage xdebug.discover_client_host=1 xdebug.log_level=0 + +; Opcache +opcache.use_cwd=0 +opcache.enable_file_override=1 +opcache.file_update_protection=0 +opcache.revalidate_freq=0 diff --git a/containers/wordpress/Dockerfile b/containers/wordpress/Dockerfile index b8e8cc6..153d5f0 100644 --- a/containers/wordpress/Dockerfile +++ b/containers/wordpress/Dockerfile @@ -11,8 +11,6 @@ RUN chmod a+x /usr/local/bin/xdebug-on && \ chmod a+x /usr/local/bin/xdebug-off && \ xdebug-off RUN chmod -R a+rwx /usr/local/etc/php/conf.d -# Use our own ini configuration file to set up some PHP default. -COPY ./php.ini /usr/local/etc/php/conf.d/999-slic.ini # Install and make wp-cli binary available and executable by all users. ADD https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar /usr/local/bin/wp diff --git a/containers/wordpress/php.ini b/containers/wordpress/php.ini index 85ac348..ddd794e 100644 --- a/containers/wordpress/php.ini +++ b/containers/wordpress/php.ini @@ -20,3 +20,9 @@ xdebug.start_with_request=yes xdebug.mode=develop,debug,coverage xdebug.discover_client_host=1 xdebug.log_level=0 + +; Opcache +opcache.use_cwd=0 +opcache.enable_file_override=1 +opcache.file_update_protection=0 +opcache.revalidate_freq=0 diff --git a/slic-stack.yml b/slic-stack.yml index 191486c..f322a8b 100644 --- a/slic-stack.yml +++ b/slic-stack.yml @@ -108,6 +108,7 @@ services: - ${SLIC_PLUGINS_DIR}:/var/www/html/wp-content/plugins - ${SLIC_THEMES_DIR}:/var/www/html/wp-content/themes - ${COMPOSER_CACHE_DIR:-./.cache}:/composer-cache + - ./containers/wordpress/php.ini:/usr/local/etc/php/conf.d/zz-docker.ini healthcheck: # Apache service should be running correctly. test: service apache2 status start_period: 5s @@ -197,6 +198,8 @@ services: - ${COMPOSER_CACHE_DIR:-./.cache}:/composer-cache # Scripts volume - ${SLIC_SCRIPTS}:/slic-scripts + # Configurable php.ini volume + - ./containers/slic/php.ini:/usr/local/etc/php/conf.d/zz-docker.ini extra_hosts: # Set as host=host.docker.internal in src/slic.php on Linux for XDebug. - "${host:-host}:host-gateway" From 60511afb4f4bbfa768dc9a08ea2e22e72fa51ed8 Mon Sep 17 00:00:00 2001 From: Justin Frydman Date: Fri, 30 Aug 2024 10:00:00 -0600 Subject: [PATCH 2/8] Improve opcache configuration --- containers/slic/php.ini | 5 +++++ containers/wordpress/php.ini | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/containers/slic/php.ini b/containers/slic/php.ini index ddd794e..6b3363a 100644 --- a/containers/slic/php.ini +++ b/containers/slic/php.ini @@ -26,3 +26,8 @@ opcache.use_cwd=0 opcache.enable_file_override=1 opcache.file_update_protection=0 opcache.revalidate_freq=0 +opcache.validate_timestamps=1 +opcache.max_accelerated_files=25000 +opcache.memory_consumption=128 +opcache.interned_strings_buffer=16 + diff --git a/containers/wordpress/php.ini b/containers/wordpress/php.ini index ddd794e..1ca6695 100644 --- a/containers/wordpress/php.ini +++ b/containers/wordpress/php.ini @@ -26,3 +26,7 @@ opcache.use_cwd=0 opcache.enable_file_override=1 opcache.file_update_protection=0 opcache.revalidate_freq=0 +opcache.validate_timestamps=1 +opcache.max_accelerated_files=25000 +opcache.memory_consumption=128 +opcache.interned_strings_buffer=16 From cfd3cf968ddaeda1c77ab5c11a62e035bdbad289 Mon Sep 17 00:00:00 2001 From: Justin Frydman Date: Fri, 30 Aug 2024 10:03:23 -0600 Subject: [PATCH 3/8] simplify opcache --- containers/slic/php.ini | 3 --- containers/wordpress/php.ini | 3 --- 2 files changed, 6 deletions(-) diff --git a/containers/slic/php.ini b/containers/slic/php.ini index 6b3363a..7a1a249 100644 --- a/containers/slic/php.ini +++ b/containers/slic/php.ini @@ -22,9 +22,6 @@ xdebug.discover_client_host=1 xdebug.log_level=0 ; Opcache -opcache.use_cwd=0 -opcache.enable_file_override=1 -opcache.file_update_protection=0 opcache.revalidate_freq=0 opcache.validate_timestamps=1 opcache.max_accelerated_files=25000 diff --git a/containers/wordpress/php.ini b/containers/wordpress/php.ini index 1ca6695..9384500 100644 --- a/containers/wordpress/php.ini +++ b/containers/wordpress/php.ini @@ -22,9 +22,6 @@ xdebug.discover_client_host=1 xdebug.log_level=0 ; Opcache -opcache.use_cwd=0 -opcache.enable_file_override=1 -opcache.file_update_protection=0 opcache.revalidate_freq=0 opcache.validate_timestamps=1 opcache.max_accelerated_files=25000 From 4a4ef7e97ee83b57c5989520f9475f01288f3825 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Fri, 30 Aug 2024 18:09:47 +0200 Subject: [PATCH 4/8] doc(slic.php, changelog.md) update per version 1.7.2 --- changelog.md | 3 +++ slic.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 1a3053a..e311443 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +# [1.7.2] - 2024-08-30 +* Fixed - Set the `opcache.revalidate_freq` to `0` in the `slic` and `wordpress` containers to avoid issues with cached files in tests. + # [1.7.1] - 2024-08-30 * Fixed - Run the `playwright install` command as root, allow running Playwright tests as the `slic` user. * Change - The `playwright install` command will now install only the Chromium browser and its dependencies. diff --git a/slic.php b/slic.php index 69829a6..f94f182 100644 --- a/slic.php +++ b/slic.php @@ -34,7 +34,7 @@ ] ); $cli_name = 'slic'; -const CLI_VERSION = '1.7.1'; +const CLI_VERSION = '1.7.2'; // If the run-time option `-q`, for "quiet", is specified, then do not print the header. if ( in_array( '-q', $argv, true ) || ( in_array( 'exec', $argv, true ) && ! in_array( 'help', $argv, true ) ) ) { From eb3a5b0558aa4c54e008677458d452416c58f106 Mon Sep 17 00:00:00 2001 From: Justin Frydman Date: Fri, 30 Aug 2024 10:28:01 -0600 Subject: [PATCH 5/8] Try using ghcr.io for base images --- containers/slic/Dockerfile | 6 +++--- containers/wordpress/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/containers/slic/Dockerfile b/containers/slic/Dockerfile index bee8fe5..c06e126 100644 --- a/containers/slic/Dockerfile +++ b/containers/slic/Dockerfile @@ -1,10 +1,10 @@ ARG PHP_VERSION=7.4 # Source Composer 1 and 2 from the respective images, multi-layer builds. -FROM composer:1 AS composer1 -FROM composer:2 AS composer2 +FROM ghcr.io/composer/composer:1 AS composer1 +FROM ghcr.io/composer/composer:2 AS composer2 -FROM php:${PHP_VERSION} +FROM ghcr.io/php/php:${PHP_VERSION} ARG NODE_VERSION=18.13.0 ARG NVM_VERSION=v0.39.7 diff --git a/containers/wordpress/Dockerfile b/containers/wordpress/Dockerfile index 153d5f0..bdb9717 100644 --- a/containers/wordpress/Dockerfile +++ b/containers/wordpress/Dockerfile @@ -2,7 +2,7 @@ ARG WORDPRESS_IMAGE_VERSION=wordpress/apache ARG PHP_VERSION=7.4 ARG WP_VERSION=6.1 -FROM wordpress:${WP_VERSION}-php${PHP_VERSION}-apache +FROM ghcr.io/wordpress/wordpress:${WP_VERSION}-php${PHP_VERSION}-apache ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN chmod a+x /usr/local/bin/install-php-extensions && install-php-extensions xdebug COPY xdebug-on.sh /usr/local/bin/xdebug-on From fe25f8fb26b0ecf69931f22a7f1a52c333450d0c Mon Sep 17 00:00:00 2001 From: Justin Frydman Date: Fri, 30 Aug 2024 11:08:29 -0600 Subject: [PATCH 6/8] Revert "Try using ghcr.io for base images" This reverts commit eb3a5b0558aa4c54e008677458d452416c58f106. --- containers/slic/Dockerfile | 6 +++--- containers/wordpress/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/containers/slic/Dockerfile b/containers/slic/Dockerfile index c06e126..bee8fe5 100644 --- a/containers/slic/Dockerfile +++ b/containers/slic/Dockerfile @@ -1,10 +1,10 @@ ARG PHP_VERSION=7.4 # Source Composer 1 and 2 from the respective images, multi-layer builds. -FROM ghcr.io/composer/composer:1 AS composer1 -FROM ghcr.io/composer/composer:2 AS composer2 +FROM composer:1 AS composer1 +FROM composer:2 AS composer2 -FROM ghcr.io/php/php:${PHP_VERSION} +FROM php:${PHP_VERSION} ARG NODE_VERSION=18.13.0 ARG NVM_VERSION=v0.39.7 diff --git a/containers/wordpress/Dockerfile b/containers/wordpress/Dockerfile index bdb9717..153d5f0 100644 --- a/containers/wordpress/Dockerfile +++ b/containers/wordpress/Dockerfile @@ -2,7 +2,7 @@ ARG WORDPRESS_IMAGE_VERSION=wordpress/apache ARG PHP_VERSION=7.4 ARG WP_VERSION=6.1 -FROM ghcr.io/wordpress/wordpress:${WP_VERSION}-php${PHP_VERSION}-apache +FROM wordpress:${WP_VERSION}-php${PHP_VERSION}-apache ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN chmod a+x /usr/local/bin/install-php-extensions && install-php-extensions xdebug COPY xdebug-on.sh /usr/local/bin/xdebug-on From 6aa4438445c231792b446ff160d5b4a99d65a883 Mon Sep 17 00:00:00 2001 From: Justin Frydman Date: Fri, 30 Aug 2024 11:17:49 -0600 Subject: [PATCH 7/8] try a different namespace/image name for composer --- containers/slic/Dockerfile | 6 +++--- containers/wordpress/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/containers/slic/Dockerfile b/containers/slic/Dockerfile index bee8fe5..cfeedb6 100644 --- a/containers/slic/Dockerfile +++ b/containers/slic/Dockerfile @@ -1,10 +1,10 @@ ARG PHP_VERSION=7.4 # Source Composer 1 and 2 from the respective images, multi-layer builds. -FROM composer:1 AS composer1 -FROM composer:2 AS composer2 +FROM ghcr.io/composer/docker:1 AS composer1 +FROM ghcr.io/composer/docker:2 AS composer2 -FROM php:${PHP_VERSION} +FROM ghcr.io/php/php:${PHP_VERSION} ARG NODE_VERSION=18.13.0 ARG NVM_VERSION=v0.39.7 diff --git a/containers/wordpress/Dockerfile b/containers/wordpress/Dockerfile index 153d5f0..bdb9717 100644 --- a/containers/wordpress/Dockerfile +++ b/containers/wordpress/Dockerfile @@ -2,7 +2,7 @@ ARG WORDPRESS_IMAGE_VERSION=wordpress/apache ARG PHP_VERSION=7.4 ARG WP_VERSION=6.1 -FROM wordpress:${WP_VERSION}-php${PHP_VERSION}-apache +FROM ghcr.io/wordpress/wordpress:${WP_VERSION}-php${PHP_VERSION}-apache ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN chmod a+x /usr/local/bin/install-php-extensions && install-php-extensions xdebug COPY xdebug-on.sh /usr/local/bin/xdebug-on From f126e78e1631949d2109baf8eecc3ec7575b8e9c Mon Sep 17 00:00:00 2001 From: Justin Frydman Date: Fri, 30 Aug 2024 14:53:26 -0600 Subject: [PATCH 8/8] Revert "try a different namespace/image name for composer" This reverts commit 6aa4438445c231792b446ff160d5b4a99d65a883. --- containers/slic/Dockerfile | 6 +++--- containers/wordpress/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/containers/slic/Dockerfile b/containers/slic/Dockerfile index cfeedb6..bee8fe5 100644 --- a/containers/slic/Dockerfile +++ b/containers/slic/Dockerfile @@ -1,10 +1,10 @@ ARG PHP_VERSION=7.4 # Source Composer 1 and 2 from the respective images, multi-layer builds. -FROM ghcr.io/composer/docker:1 AS composer1 -FROM ghcr.io/composer/docker:2 AS composer2 +FROM composer:1 AS composer1 +FROM composer:2 AS composer2 -FROM ghcr.io/php/php:${PHP_VERSION} +FROM php:${PHP_VERSION} ARG NODE_VERSION=18.13.0 ARG NVM_VERSION=v0.39.7 diff --git a/containers/wordpress/Dockerfile b/containers/wordpress/Dockerfile index bdb9717..153d5f0 100644 --- a/containers/wordpress/Dockerfile +++ b/containers/wordpress/Dockerfile @@ -2,7 +2,7 @@ ARG WORDPRESS_IMAGE_VERSION=wordpress/apache ARG PHP_VERSION=7.4 ARG WP_VERSION=6.1 -FROM ghcr.io/wordpress/wordpress:${WP_VERSION}-php${PHP_VERSION}-apache +FROM wordpress:${WP_VERSION}-php${PHP_VERSION}-apache ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN chmod a+x /usr/local/bin/install-php-extensions && install-php-extensions xdebug COPY xdebug-on.sh /usr/local/bin/xdebug-on