【问题标题】:Deployment of Vuejs - webpack webapp on Google App Engine部署 Vuejs - Google App Engine 上的 webpack webapp
【发布时间】:2018-06-29 17:53:13
【问题描述】:

我正在构建我的第一个 Vue.js 网络应用程序。 我已经使用以下方法设置了一个新项目:

vue init webpack <project_name>

我已经完成了一些工作,几乎所有事情都按照我的意愿进行(除了 sass,但这是另一个故事)。 我现在想将我的 webapp 部署到谷歌应用引擎。 我在 GAE 上创建了一个新的 node.js 项目。 我已经创建了我的 app.yaml(见下文)。 我用通常的方式部署

gcloud app deploy --project="<project_name>"

但是在很长一段时间(~5-8分钟)后部署失败

Updating service [default]...failed.                                                                                                                   

ERROR: (gcloud.app.deploy) Error Response: [4] Your deployment has 
failed to become healthy in the allotted time and therefore was 
rolled back. If you believe this was an error, try adjusting the 
'app_start_timeout_sec' setting in the 'readiness_check' section.

我目前的项目结构是:

  • 构建/
  • 配置/
  • 分布/
    • index.html
    • 静态
      • css/
      • 图片/
      • js/
  • 节点模块/
  • 源/
    • 组件/
    • scss/
    • App.vue
    • main.js
  • 静态/
  • package.json
  • babel.rc
  • index.html
  • app.yaml

我的 app.yaml 是:

runtime: nodejs
env: flex

handlers:
- url: /
  static_files: dist/index.html
  upload: dist/index.html

- url: /(.*)
  static_files: dist/\1
  upload: dist/(.*)

【问题讨论】:

    标签: node.js google-app-engine deployment webpack vue.js


    【解决方案1】:

    在 app.yaml 文件中添加此配置

    runtime: php55
    threadsafe: true
    
    handlers:
    - url: /
      static_files: dist/index.html
      upload: dist/index.html
    
    - url: /(.*)
      static_files: dist/\1
      upload: dist/(.*)
    

    【讨论】:

      【解决方案2】:

      错误信息提示:

      您的部署未能在分配的时间内变得健康

      浏览Health checks 文档。

      5-8 分钟的部署时间并不少见,见Google cloud deploy so slow

      【讨论】:

        猜你喜欢
        • 2023-03-02
        • 2015-02-19
        • 2020-08-18
        • 2012-02-11
        • 1970-01-01
        • 2015-11-13
        • 2016-07-13
        • 2013-03-11
        • 2020-04-19
        相关资源
        最近更新 更多