Apache, PHP, WordPress caching issue in Docker container
It turns out this was caused by opcache in PHP. Opcache was enabled in the wordpress docker image as follows:
RUN { \ echo 'opcache.memory_consumption=128'; \ echo 'opcache.interned_strings_buffer=8'; \ echo 'opcache.max_accelerated_files=4000'; \ echo 'opcache.revalidate_freq=60'; \ echo 'opcache.fast_shutdown=1'; \ echo 'opcache.enable_cli=1'; \ } > /usr/local/etc/php/conf.d/opcache-recommended.ini
So, I created a new docker image for wordpress that disables caching. It's essentially this:
FROM wordpress:latestRUN rm -rf /usr/local/etc/php/conf.d/opcache-recommended.ini