【发布时间】:2021-10-14 11:48:22
【问题描述】:
我有一个使用 gcr.io/google-appengine/nodejs 进行 Docker 化的 node.js 应用程序,并且部署和运行良好。知道默认情况下 GAE 将运行 package.json 中的“启动”脚本,我只是用运行没问题的next start -p 8080 替换了已经存在的脚本。
我想触发一个替代脚本而不是“启动”,因此我创建了一个名为“cloud-start”的脚本并将上述命令作为值插入。在 app.yaml 中,我添加了“入口点”属性和 yarn cloud-run 作为值:
runtime: custom
env: flex
entrypoint: yarn cloud-start
service: my-app
vm_health_check:
enable_health_check: False
manual_scaling:
instances: 1
resources:
memory_gb: 4
“cloud-start”脚本从未执行过——我什至尝试用“npm”替换“yarn”,但仍然没有成功。为什么我的入口点不会触发?
这是我的 Dockerfile,以防万一:
# Use the base App Engine Docker image, based on Ubuntu 16.0.4.
FROM gcr.io/google-appengine/nodejs
# Install locate for debugging purposes
RUN apt-get update -y && \
apt-get install --no-install-recommends -y -q \
locate
COPY . /app
WORKDIR /app
RUN npm install --global yarn
RUN yarn
RUN yarn static
EXPOSE 8080
【问题讨论】:
-
你能编辑你的问题并包含 package.json 文件吗?还包括来自应用引擎日志的错误消息。
标签: reactjs docker google-app-engine next.js app.yaml