How to setup Ghost on Synology Docker

Ghost has recently started to support MySQL and dropped support for SQLite.
Here's how you can set it up on Synology Docker.

Prerequisites

  1. Go to Package Center and install Docker
  2. Go to File stations and navigate to Docker folder
  3. Create two folders, ghost-app and ghost-db
  4. Open Docker on Synology and select Registry tab
  5. Search for Ghost and MySQL, download both with latest tag
  6. Buy me a drink on Ko-fi :)

Create MySQL Container

  1. Go to Container tab and Create a Container:
    1. Select Image: mysql
    2. Network: bridge
    3. Container Name: ghost-db
  2. Go to Advanced Settings
  3. Add the following Enviroment variables:
    1. MYSQL_ROOT_PASSWORD = mysqlrootpassword
    2. MYSQL_DATABASE = ghost
    3. MYSQL_USER = ghostuser
    4. MYSQL_PASSWORD = ghostpass
  4. Review, click Save, then Next
  5. Leave the Port settings as default, click Next
  6. Click Add Folder, navigate to the ghost-db folder
  7. Add the mount path as /var/lib/mysql
  8. Click Next and Done

Before you continue, be sure to check that the DB is ready. This should take ~5 mins.
While waiting, go to Prerequisites Step 6.

  1. Double-click the Container and go to Logs tab
  2. Look for the line that says /usr/sbin/mysqld: ready for connections.

Create Ghost Container

  1. Go to Container tab and Create a Container:
    1. Select Image: ghost
    2. Network: bridge
    3. Container Name: ghost-app
    4. Enable auto-restart
  2. Go to Advanced Settings
  3. Add the following Enviroment variables:
    1. database__client = mysql
    2. database__connection__host = ghost-db
    3. database__connection__port = 3306
    4. database__connection__user = ghostuser
    5. database__connection__password = ghostpass
    6. database__connection__database = ghost
    7. url = http://[NAS IP Address]:2368
  4. Select Links tab and click Add
  5. Select the Container name that you've created for MySQL, eg. ghost-db
  6. Click Save, then Next
  7. Set the Local Port to 2368, click Next
  8. Click Add Folder, navigate to the ghost-app folder
  9. Add the mount path as /var/lib/ghost/content
  10. Click Next and Done

Go get a coffee and send me a tip as this will take at least 10 mins and if you go to your NAS IP Address with the port you've defined above on a browser, eg. http://192.168.1.10:2368
You'll be greeted a working in progress screen.
Once that is completed, go to /ghost to begin the setup.