ghost在之前更新到5之后就默认是用mysql,然而这导致在docker-compose.yml中写非常麻烦,还需要设置端口,管理员和博客数据库密码。其实还是可以沿用之前的sqlite的,而且非常简单,docker-compose.yml如下:

version: '3.8'

services:
  ghost:
    image: ghost:latest
    container_name: ghost
    restart: unless-stopped
    ports:
      - "2368:2368"
    volumes:
      - /vol1/1000/docker/ghost:/var/lib/ghost/content
    environment:
      url: http://localhost:2368
      database__client: sqlite3
      database__connection__filename: /var/lib/ghost/content/data/ghost.db
      database__useNullAsDefault: "true"
      database__debug: "false"

docker up启完之后访问localhost:2368/ghost就可以进入配置页面,配置站点信息和账号密码了。非常方便

标签:无

你的评论