Featured image of post 使用云应用部署 ghost 博客

使用云应用部署 ghost 博客

Ghost 是一套基于 Node.js 构建的开源博客平台(Open source blogging platform),具有扩展性高、主题丰富、使用简单等特点。

下面就简单的说一下使用云应用部署 ghost 的过程。

  1. 安装 CloudBase CLI 工具:npm i -g @cloudbase/cli
  2. 创建服务名,获取镜像仓库路径:imageUrl
  3. 使用 framework 部署

参考配置:cloudbaserc.json

{
  "envId": "envId",
  "framework": {
    "plugins": {
      "client": {
        "use": "@cloudbase/framework-plugin-container",
        "inputs": {
          "uploadType": "image",
          "serviceName": "blog",
          "servicePath": "/",
          "containerPort": 2368,
          "imageInfo": {
            "imageUrl": "镜像地址"
          },
          // 数据库配置
          "envVariables": {
            "database__client": "mysql",
            "database__connection__host": "db.host.com",
            "database__connection__user": "user",
            "database__connection__password": "xxx",
            "database__connection__database": "db",
            "database__connection__port": "23890",
            "url": "https://myblog.com"
          }
        }
      }
    }
  }
}
Licensed under CC BY-NC-SA 4.0