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:
Preparing Apache for caching (through the WP Super Cache plugin)
Raising the upload limit in both PHP and Apache2
Installing two plugins: WP Super Cache and WP Mail SMTP
There are two small steps to be performed to obtain website caching through WP Super Cache—we need to enable the mod_headers
and 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 expires headers
We make those edits, build a new image, and see what happens. It takes a long time to build these images, since PHP is built from source. What we are looking for are lines that state that our modules are enabled. They will show...