/ docker

Start blogging in 5 minutes with Ghost and Docker

Today I was scanning Docker Hub for the most popular Docker Images and within the first results a Docker Image called Ghost with more than 10 milion pulls caught my attention.

Ghost is a free and open source blogging platform written in JavaScript

Interesting, I thought, let's see:

$ docker run -it --rm -p 2368:2368 ghost

Opened my browser, typed http://localhost:2368 and boom, there it was, just the perfect look & feel for a clean blog.

ghost

Ok, I've said, let's see how easy it is to customize it, add and edit posts. And then, the second shock, Markdown support is built-in.

What can you possible want more from your blogging platform than to be shiny and to write posts using Markdown syntax.

Thus, went home, discarded my old blogging solution, wrote a more robust and generic Docker Orchestration with a standalone DB backend (See the complete solution with HTTPS and HTTP2 support on Github):

version: "2"
services:
  ghost:
    image: ghost:1.12.1
    restart: unless-stopped
    ports:
    - 80:2368
    environment:
      database__client: mysql
      database__connection__host: db
      database__connection__user: ${DB_USER}
      database__connection__password: ${DB_PASS}
      database__connection__database: ${DB_NAME}
      NODE_ENV: ${NODE}
      url: ${URL}
    volumes:
    - ghost:/var/lib/ghost/content
  db:
    image: mysql:5.7
    restart: unless-stopped
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: "true"
      MYSQL_DATABASE: ${DB_NAME}
      MYSQL_USER: ${DB_USER}
      MYSQL_PASSWORD: ${DB_PASS}
    volumes:
    - db:/var/lib/mysql

volumes:
  ghost:
    driver: local
  db:
    driver: local

And voilĂ , my shiny new blog!