April 27, 2023

Episode 018 - Is Ghost the right platform for this blog & me? [Part 2]

Im going to start by saying Ghost as a platform has been great in many ways. Its been easy to use, navigate and is full of cool features.

With the release of Ghost 5.0 last year I have reluctantly updated from the 4.X versions. A bit of back story, I run this site on a very small cloud vm and I use docker and docker compose to run it. With 4.X my compose file looks something like this:

---
version: "3.9"
name: blog
services:
  blog:
    image: ghost:4.48.8
    container_name: blog
    environment:
      - url=${URL}
    volumes:
      - ./content:/var/lib/ghost/content
    ports:
      - 2368:2368
    restart: unless-stopped

If this doesnt make sense then I will be doing a post about containers and compose files will be featured. But in essence this file tells docker what to call the container, what image to use, environment vairables or options if you will, volumes or paths where the data is stored on the host machine and where that is mapped on the container as well as ports where it can be reached.

This works well enough, and is not 'Production' ready , but for a hobbist blog it works perfectly well. With 5.0+ an additional container for MYSQL is needed which to me takes away some of the lightweigh of the blog as 4.X uses a sqlite database , there are definitely pros to having a full feature rich database.

---
version: '3.1'

services:

  ghost:
    image: ghost:5-alpine
    restart: always
    ports:
      - 8080:2368
    environment:
      # see https://ghost.org/docs/config/#configuration-options
      database__client: mysql
      database__connection__host: db
      database__connection__user: root
      database__connection__password: example
      database__connection__database: ghost
      # this url value is just an example, and is likely wrong for your environment!
      url: ${URL}
      # contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
      #NODE_ENV: development

  db:
    image: mysql:8.0
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: example

Here is the 5.0 compose file as an example, but the upgrade path from 4.X with sqlite to 5.0+ is to start over. Now I could backup the site which gives me a nice JSON to import all the things along with all the images but im not sure that the addition of the MYSQL database is going to slow things down to much.

I could backup this site, bring down the container and bring up the new container and test how 5.0 performs then import my backup and hope I get back up and running. Or I could look for a new blogging platform / CMS ( Content management system). If I do decide to test it out and migrate to 5.0 I'll be sure to write about it and let you know how it goes.

Now one CMS has caught my eye recently Grav the flat file CMS where every page/post is a markdown file which makes it super lightwight. And one of the amazing thing I have seen is how many themes and plugins there are for it, one plugin really got my attention was the git-sync plugin which allows you to sync your posts/pages with github and vice versa. This means with a simple commit and push to the main branch the new page/post will automagically be updated on the website.

I have only recently spun up a test server and its impressed me already, I will definitely be writing about it. Could it be the next blog/CMS platform I move to?

Let me know your thoughts over on twitter or email feedback@0lzi.com