Ghost blog, in a container, with scripts to upload static content to gcs
This is a dockerfile which allows you to build a site using the ghost blogging platform, and then generate it all as static content. It also includes the utilities required to upload it to Google Cloud Storage.
It’s pretty opinionated in that it:
That’s because it’s for my blog at https://karlstoney.com, however you’re free to use it - you’ll just need to:
Simply do a docker-compose up
. Your data will be persisted to the /data/content/
volume mounts so you can start and stop the container whenever you need.
Once ghost is running, go to http://127.0.0.1
and use it just like you would anywhere else, modify your content and so on.
When you’re happy with your content, you want to crawl the site and generate a static version so we can store it in a bucket. I’ve added one helper script in bin/generate_static_content.sh which will:
In order to run it, make sure ghost is running with docker-compose up
and then in another window do docker-compose exec app /usr/local/bin/generate_static_content.sh
.
As I mentioned above, I have a Google Cloud Storage bucket which all the static content goes into. That’s configured as a “website” for “karlstoney.com”, I then use Cloudflare free to front this as a CDN. And voilla, blog hosting for pennies per month.