O'Reilly logo

Build Your Own PaaS with Docker by Oskar Hane

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Our objective

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

Preparing for caching

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required