Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Ghost static site in a Dockerfile

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, however you're free to use it - you'll just need to:

  • edit docker-compose.yml and replace the domain with your own
  • edit patches/disqus.patch and update your disqus id

Starting ghost

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.

Editing your content

Once ghost is running, go to and use it just like you would anywhere else, modify your content and so on.

Generating your static content

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/ which will:

  • Use ghost-static-site-generator to generate the static content
  • Use gsutil to upload your content to a bucket (make sure the bucket exists for your domain)

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/

Hosting it

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 "", I then use Cloudflare free to front this as a CDN. And voilla, blog hosting for pennies per month.


Ghost blog, in a container, with scripts to upload static content to gcs




No releases published


No packages published