wordpress serverless with docker and AWS

If you are like one of us how want to create own blog site quickly and want to keep the running costs bottom low, this is for you.

Design:

  1. spin up a wordpress setup on local machine using docker compose.
  2. create blog post.
  3. generate static pages for all your posts.
    • use WP2Static plugin
  4. use AWS S3 static website hosting to take this content live.
  5. take backup of wordpress and put that in AWS S3 bucket.

All the above (other than creating content) takes less than 1 hour first time and less than 5 minutes every time after that.

Advantages:

  1. super low operational cost.
    • since you are paying only for the storage, it works out really cheap
  2. content is secure
    • given that all your wordpress content is backed up in private bucket, it is secure. only static pages are exposed live which are not vulnerable for hacking unlike non-static websites.
  3. faster website
    • static content pages are served fast by taking all the advantages of AWS CDN and since no processing is required.
  4. less prone to downtime.
    • since all the wordpress work (installing new plugins, playing with themes etc etc) is done offline, you are safe even you mess up. Just start again from the backup and you are good to go.

 

Please feel free to refer the running example code at my github