Where the data is for ghost? like: posts, users etc

  • What version of Ghost are you using?
    ghost2.9

  • What configuration?
    Dockerfile:

FROM ghost:2.9
COPY config.production.json /var/lib/ghost/config.production.json
VOLUME $PWD/content:/var/lib/ghost/content
EXPOSE 2368
CMD ["npm", "start", "--production"]

config.production.json:

{
  "database": {
    "client": "mysql",
    "connection": {
      "host": "127.0.0.1",
      "port": 3306,
      "user": "root",
      "password": "anywhere",
      "database": "ghost"
    }
  },
  "mail": {}
}

docker-compose.yml

version: '3.1'

services:

  ghost:
    image: ghost:2.9
    restart: always
    ports:
      - 2368:2368
    environment:
      url: "http://localhost:2368"

before, I’ve created the database named ghost in mysql.
but there’s nothing changed of this database after run ghost with docker-compose up and succeed to get the response from ‘http://localhost:2368’.

mysql> use ghost;
Database changed
mysql> show tables;
Empty set (0.00 sec)

mysql>

so where the data is?

image

also, I’ve changed the theme, and can see the files: massively-master
in the docker container.

root@e767518c617d:/var/lib/ghost# cd content/themes/
root@e767518c617d:/var/lib/ghost/content/themes# ls
casper	massively-master

but there’s nothing in my host content folder even if config with VOLUME $PWD/content:/var/lib/ghost/content

Project file structure:

image

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.