Node Express REST 托管在 Google 云端 运行

Node Express REST hosted in Google Cloud Run

我正在考虑设置 Google 云 运行 主机 Docker 容器服务。如果现有服务是监听端口的 Node - Express REST 服务,我是否需要删除 Express,这样它就不会一直 运行 / 监听和收费?

不,您的容器仅在接收传入请求时才会扩展。请参阅 Cloud Run Resource model docs 中的 "Cloud Run container instances"。

如果您现有的服务是 Express 应用程序,那么一切就绪。

如果您没有收到任何请求,我们不会向您收费。

只需使用 Dockerfile 将其打包到容器中,您就可以将其部署到云端 运行。看看the Node.js sample in the quickstart