{"id":5,"date":"2020-06-20T18:31:00","date_gmt":"2020-06-20T18:31:00","guid":{"rendered":"http:\/\/localhost:8000\/?p=5"},"modified":"2021-02-03T09:39:00","modified_gmt":"2021-02-03T09:39:00","slug":"wordpress-as-a-modern-12-factor-app","status":"publish","type":"post","link":"http:\/\/localhost:8000\/2020\/06\/20\/wordpress-as-a-modern-12-factor-app\/","title":{"rendered":"WordPress as a 12-factor app"},"content":{"rendered":"\n

PHP was the first programming (scripting, yes, I know) language that I learned. I had some experience using and managing WordPress, I also liked its features, and I knew that all my needs would already be covered by some plugin of the WordPress ecosystem.<\/p>\n\n\n\n

Still, I almost didn\u2019t use WordPress to power my blog. I wanted my blog to be versioned (in Git), packaged in a Docker container, and cloud ready. Some people might call it over-engineering, but I think it\u2019s just good practice.<\/p>\n\n\n\n

I didn\u2019t like how WordPress is structured, how installing plugins and themes is handled. Everything in the same folder, plugins are installed by clicking, there is no way of committing your code to git, making multiple changes, and then deploying everything to production later – without breaking the site. Or so I thought!<\/p>\n\n\n\n

Fortunately, WordPress\u2019 Core supports customization of the structure of your project, which makes it work with PHP\u2019s dependency management system – Composer. There are multiple approaches to it, but I\u2019ve decided to use Bedrock<\/a>, because it nicely follows the principles of the 12-factor app<\/a>.<\/p>\n\n\n\n

Let\u2019s start!<\/p>\n\n\n\n

WordPress requires<\/a>:<\/p>\n\n\n\n