Ghost running on serverless

I’ve seen people asked here if we could run Ghost on serverless.
I’d like to show that I’ve got a working version!

Totally open-source over at github:

I’ve managed to integrate the various AWS services like S3 and SES.

Let me know what you think in the comments!

1 Like

I ran Ghost on Google Cloud Run for a few years (github.com/behoyh/ghost)

The problem with this and other solutions is the cold start mechanism takes 1-2 minutes. The users I was supporting complained that the site never worked.

I ended up just running Ghost in a docker container in a free Google Cloud vm instance to get around the issue with the awesome google drive storage plugin.

1 Like

1-2 minutes seems pretty long for a startup, I wonder if a v8 heap snapshot or some other suspending mechanism would help.

It feels like it should be possible to get ghost started up faster than that, especially if it the node process can just be frozen & reloaded.

I’m super keen to see a solution for this too. I’ve tried setting my minimum instances on CloudRun to 1, so theoretically it should stick around, but even in this configuration GCP will randomly restart an instance if it wants to.

For now I’ll probably go with a VM setup, but it’d be great to get a proper CloudRun/serverless option, especially because if we’re using Ghost as Newsletter site, it’ll be idle for a long time between mail outs.

Log output showing 88 second startup time, even with the database ready to go