我正在尝试部署到谷歌应用引擎。当我这样做时,初始信息似乎都是正确的,docker构建成功,但是在docker之后它会尝试以下操作并失败:
Beginning teardown of remote build environment (this may take a few seconds).
Updating module [default].../Deleted [https://www.googleapis.com/compute/v1/projects/jamsesh-1219/zones/us-central1-f/instances/gae-builder-vm-20160213t114355].
Updating module [default]...failed.
ERROR: (gcloud.preview.app.deploy) Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).
我知道我运行的es6代码被编译为在节点4.1.2上运行,这是我告诉我可以使用here的版本 - 我只需运行nvm install v4.1.2
即可切换我,所以我把它包括在我的脚本中。这是我在package.json中的脚本:
"scripts": {
"test": "test",
"clean": "rm -rf lib",
"watch-js": "./node_modules/.bin/babel --plugins transform-es2015-classes src --presets react -d lib",
"dev-server": "./node_modules/.bin/webpack lib/client/entry.js",
"lint": "./node_modules/.bin/eslint ./src",
"server": "node lib/server/server",
"start-dev": "npm run lint && npm run build && npm run dev-server && npm run server",
"start": "nvm install v4.1.2 && node lib/server/server",
"styles": "./node_modules/.bin/lessc ./public/less/bundle.less ./public/css/bundle.css",
"build": "npm run clean && ./node_modules/.bin/babel --plugins transform-es2015-classes src --presets react -d lib && npm run styles"
},
和我的泊坞文件:
# Dockerfile extending the generic Node image with application files for a
# single application.
FROM gcr.io/google_appengine/nodejs
COPY . /app/
# You have to specify "--unsafe-perm" with npm install
# when running as root. Failing to do this can cause
# install to appear to succeed even if a preinstall
# script fails, and may have other adverse consequences
# as well.
# This command will also cat the npm-debug.log file after the
# build, if it exists.
RUN npm install --unsafe-perm || \
((if [ -f npm-debug.log ]; then \
cat npm-debug.log; \
fi) && false)
CMD npm start
所以是的,我不知道部署失败的原因。我肯定可以从有关在GAE上部署节点的更全面的文档中受益。它适用于测试仓库。还有什么我需要做的事情,用我的babel6转换代码在GAE上运行节点吗?或者我的脚本中应该有什么不同?在Google Shell中,一旦切换到节点v4.1.2
,我就可以在本地运行