To make this WordPress image useable for more than demo purposes, we need to modify the Dockerfile in three ways. Our objectives are as follows:
There are two small steps to be performed to obtain website caching through WP Super Cache—we need to enable the
mod_expires modules in Apache2.
On line 5 in the Dockerfile, you can see
RUN a2enmod rewrite. The
a2enmod command enables modules in Apache2, and modules are disabled by the
a2dismod command. Enabling our desired modules is as easy as appending them to that line:
RUN a2enmod rewrite ...