How to deploy Ghost CMS in a cloud environment using Traefik?

How to deploy Ghost CMS in a cloud environment using Traefik?

Blog Single

Why we decided to use Ghost for our projects and clients

Ghost is a powerful app for professional publishers to create, share, and grow a business around their content. It comes with modern tools to build a website, publish content, send newsletters & offer paid subscriptions to members.
Ghost is the fast, modern WordPress alternative, focused completely on professional publishing.

Chalenges of adopting Ghost to Cloud environment
 

We are deploying Ghost on k8s cluster, below image demonstrates request flow to our Ghost application

The issue here is ghost application will be load with https on browser but k8s pod need to listen http request from Traefik.
This is a struggle issue.


Our Ghost fork as solution to Cloud deployment

To resolve this problem, we decide to make a fork from Ghost repository to build our own docker image to run on k8s.
The idea is we still can set ghost url with https but inside code logic, we deal with requests as http.
We solved problem following below steps.

  • Make a fork from Ghost repository https://github.com/ardeetech/Ghost
  • Update all logics urlUtils.isSSL(config.get('url')) to be false, you can check commit "Ignore SSL force" on our github
  • Build docker image with current changes then apply to k8s cluster

Hopefully this article can help you when you deploy Ghost CMS on k8s! Enjoy it!