Docker: Deploying Production Instance

If you’re looking for help, please provide information about your environment. If you delete this template and don’t provide any information, your topic will be automatically closed.

If you aren’t running the latest version of Ghost, the first thing we’ll ask you to do is update to the latest version of Ghost.

  • What’s your URL? Not currently deployed.
  • What version of Ghost are you using? 3.1

And

  • How was Ghost installed and configured? Docker (not yet working)
  • What Node version, database, OS & browser are you using? MySQL, Manjaro Linux, Firefox generally.
  • What errors or information do you see in the console? The launch of MySQL is simply restarting over and over again based on default docker yaml provided here: https://hub.docker.com/_/ghost/ - full yaml below.
  • What steps could someone else take to reproduce the issue you’re having? I simply copied the available yaml and tried launching. After various attempts and failures I tried simply spinning up MySQL docker (from yaml, running “docker compose up -d db”) and here’s what I see:

488c3e111781 mysql:8.0 “docker-entrypoint.s…” 17 hours ago Restarting (1) 37 seconds ago ghost-db-1

It’s been in a restart cycle for 30 minutes about.

Here is my full yaml - obviously “example” will be changed once I can successfully get this up and running.

FWIW I did get the developer version up and running with the provided docker command:

$ docker run -d --name some-ghost -e NODE_ENV=development -e url=http://[IP]:3001 -p 3001:2368 ghost
version: '3.1'

services:

  ghost:
    image: ghost:5-alpine
    restart: always
    ports:
      - 3001: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: https://dysfunctionalreading.khaos-monkey.com/
      # 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
    volumes:
      - ghost:/var/lib/ghost/content

  db:
    image: mysql:8.0
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: example
    volumes:
      - db:/var/lib/mysql

volumes:
  ghost:
  db:

And FWIW, last couple dozen lines of log for the container:

2024-12-01T16:32:26.422595Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2024-12-01T16:32:26.424105Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.40) starting as process 1
2024-12-01T16:32:26.433987Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory.
2024-12-01T16:32:26.434022Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-12-01T16:32:26.479171Z 1 [ERROR] [MY-012224] [InnoDB] Tablespace flags are invalid in datafile: ./ibdata1, Space ID:0, Flags: 21. Please refer to http://dev.mysql.com/doc/refman/8.0/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2024-12-01T16:32:26.479218Z 1 [ERROR] [MY-012237] [InnoDB] Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
2024-12-01T16:32:26.479238Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Data structure corruption.
2024-12-01T16:32:26.978566Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
2024-12-01T16:32:26.978820Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-12-01T16:32:26.978843Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-12-01T16:32:26.979419Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.40)  MySQL Community Server - GPL.
2024-12-01 16:33:27+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.40-1.el9 started.
2024-12-01 16:33:27+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-12-01 16:33:27+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.40-1.el9 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-12-01T16:33:28.061427Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2024-12-01T16:33:28.063015Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.40) starting as process 1
2024-12-01T16:33:28.073049Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory.
2024-12-01T16:33:28.073085Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-12-01T16:33:28.117684Z 1 [ERROR] [MY-012224] [InnoDB] Tablespace flags are invalid in datafile: ./ibdata1, Space ID:0, Flags: 21. Please refer to http://dev.mysql.com/doc/refman/8.0/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2024-12-01T16:33:28.117740Z 1 [ERROR] [MY-012237] [InnoDB] Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
2024-12-01T16:33:28.117766Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Data structure corruption.
2024-12-01T16:33:28.617135Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
2024-12-01T16:33:28.617410Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-12-01T16:33:28.617432Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-12-01T16:33:28.617979Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.40)  MySQL Community Server - GPL.
2024-12-01 16:34:29+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.40-1.el9 started.
2024-12-01 16:34:29+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-12-01 16:34:29+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.40-1.el9 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-12-01T16:34:29.711388Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2024-12-01T16:34:29.712900Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.40) starting as process 1
2024-12-01T16:34:29.845461Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory.
2024-12-01T16:34:29.845496Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-12-01T16:34:29.889647Z 1 [ERROR] [MY-012224] [InnoDB] Tablespace flags are invalid in datafile: ./ibdata1, Space ID:0, Flags: 21. Please refer to http://dev.mysql.com/doc/refman/8.0/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2024-12-01T16:34:29.889696Z 1 [ERROR] [MY-012237] [InnoDB] Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
2024-12-01T16:34:29.889722Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Data structure corruption.
2024-12-01T16:34:30.389145Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
2024-12-01T16:34:30.389530Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-12-01T16:34:30.389555Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-12-01T16:34:30.390136Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.40)  MySQL Community Server - GPL.
2024-12-01 16:35:30+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.40-1.el9 started.
2024-12-01 16:35:30+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-12-01 16:35:30+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.40-1.el9 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-12-01T16:35:31.458166Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2024-12-01T16:35:31.459650Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.40) starting as process 1
2024-12-01T16:35:31.469327Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory.
2024-12-01T16:35:31.469366Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-12-01T16:35:31.512195Z 1 [ERROR] [MY-012224] [InnoDB] Tablespace flags are invalid in datafile: ./ibdata1, Space ID:0, Flags: 21. Please refer to http://dev.mysql.com/doc/refman/8.0/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2024-12-01T16:35:31.512241Z 1 [ERROR] [MY-012237] [InnoDB] Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
2024-12-01T16:35:31.512267Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Data structure corruption.
2024-12-01T16:35:32.011752Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
2024-12-01T16:35:32.012142Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-12-01T16:35:32.012184Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-12-01T16:35:32.012909Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.40)  MySQL Community Server - GPL.
2024-12-01 16:36:32+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.40-1.el9 started.
2024-12-01 16:36:32+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-12-01 16:36:32+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.40-1.el9 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-12-01T16:36:33.055808Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2024-12-01T16:36:33.057317Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.40) starting as process 1
2024-12-01T16:36:33.067256Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory.
2024-12-01T16:36:33.067291Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-12-01T16:36:33.111778Z 1 [ERROR] [MY-012224] [InnoDB] Tablespace flags are invalid in datafile: ./ibdata1, Space ID:0, Flags: 21. Please refer to http://dev.mysql.com/doc/refman/8.0/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2024-12-01T16:36:33.111823Z 1 [ERROR] [MY-012237] [InnoDB] Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
2024-12-01T16:36:33.111844Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Data structure corruption.
2024-12-01T16:36:33.611203Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
2024-12-01T16:36:33.611460Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-12-01T16:36:33.611482Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-12-01T16:36:33.612043Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.40)  MySQL Community Server - GPL.
2024-12-01 16:37:33+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.40-1.el9 started.
2024-12-01 16:37:34+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-12-01 16:37:34+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.40-1.el9 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-12-01T16:37:34.660452Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2024-12-01T16:37:34.661938Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.40) starting as process 1
2024-12-01T16:37:34.671841Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory.
2024-12-01T16:37:34.671876Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-12-01T16:37:34.716765Z 1 [ERROR] [MY-012224] [InnoDB] Tablespace flags are invalid in datafile: ./ibdata1, Space ID:0, Flags: 21. Please refer to http://dev.mysql.com/doc/refman/8.0/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2024-12-01T16:37:34.716813Z 1 [ERROR] [MY-012237] [InnoDB] Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
2024-12-01T16:37:34.716839Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Data structure corruption.
2024-12-01T16:37:35.216285Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
2024-12-01T16:37:35.216581Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-12-01T16:37:35.216609Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-12-01T16:37:35.217182Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.40)  MySQL Community Server - GPL.

Try this docker compose file…

  1. you can use image: ghost:latest on arm64 as well
  2. Map /content to your local file system to store images etc, create a folder /content in the directory where you keep docker-compose.yml
  3. First docker compose pull and then docker compose up to get the logfile in console and see Ghost launching. Then you can kill it with ctrl-C and docker compose up -d to deamonize
  4. e-mail settings included, STARTTLS on 587 starts unencrypted and upgrades, thus mail__options__secure: false
services:
  ghost:
    image: ghost:latest
    restart: always
    ports:
      -  3001:2368
    environment:
      database__connection__host: db
      database__connection__user: root
      database__connection__password: dbRootPass12345
      database__connection__database: ghost
      url: https://example.com
      mail__options__auth__pass: smtpPassword
      mail__options__auth__user: smtpUser
      mail__options__host: smtp.example.com
      mail__options__port: 587
      mail__options__secure: false
      mail__options__service: smtpService
      mail__transport: SMTP
      mail__from: sender@example.com
    links:
      -  db
    volumes:
      -  /home/user/dockerghost/content:/var/lib/ghost/content
    depends_on:
      -  db
  db:
    image: arm64v8/mysql:8
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: dbRootPass12345
      MYSQL_DATABASE: ghost
      MYSQL_USER: ghost
      MYSQL_PASSWORD: dbGhostPass12345
    volumes:
      - mysql-data:/var/lib/mysql

volumes:
  mysql-data:
2 Likes

I was able to resolve this by purging the container directory and just starting from scratch. I’m not sure what the hiccup was but it’s resolved. Thanks!