As I continue my journey to understanding how to deploy container applications at scale… I’m trying to build the most simple non-trivial Wordpress deployment in containers. My end-goal for this step (lots more to do!) is this:
- nginx serving as a reverse proxy cache for the application, caching static elements
- One Apache/PHP node running WordPress with WP Super Cache pre-installed and enabled
- One memcached node providing an object cache for WordPress
- A MySQL Server node for data persistence
- “Decent” hygiene: all modified files stored in version control, secrets provided through secret files rather than environment variables/hard coded, and daily database back-ups
I’d love to automate everything, including instance provisioning, various firewall and permissions settings I have come across, and to have a decent monitoring framework around the instance - but that’s all later. Right now, my main question is: what’s the best practice way for me to manage adding a plugin to WordPress? Should I build a custom contaner “FROM wordpress” that installs and enables the plugin? Or should I add a build step to my docker-compose.yml? And if so, how do you do that? I have not done that before. Is there another way? I have the WordPress directory in a volume mounted on the host, so I could wget and uncompress the zip file for the plug-in, but (if I understand correctly) that won’t survive the first time I upgrade WordPress, which isn’t ideal.
Thanks for the suggestions!