运行Google 云 运行 上的 ning Logux 找不到 运行 端口

Running Logux on Google Cloud Run doesn't find the running port

尝试在 Cloud 运行 中获取 Logux 运行ning 时,出现此错误:

Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable.

即使服务器 运行 正在运行,Dockerfile 也会公开正确的端口(也映射到云端 运行)。

Dockerfile 位于此处:https://github.com/knownasilya/battle-chess/blob/main/Dockerfile

请注意,服务器 运行s https 和 ws 在端口 31337 上。

如云所述运行 Troubleshooting docs,如果我们收到消息:

Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable.

而且我们知道我们的 code/container 正在按预期工作,我们应该检查云 运行 将检查的端口是否与我们的应用程序中使用的端口相关联,就像在这种情况下一样,容器监听 0.0.0.0(所有网络接口)

云中也提到了这一点 运行 Requirements doc:

The container must listen for requests on 0.0.0.0 on the port to which requests are sent. By default, requests are sent to 8080, but you can configure Cloud Run to send requests to the port of your choice. Cloud Run injects the PORT environment variable into the container. Inside Cloud Run container instances, the value of the PORT environment variable always reflects the port to which requests are sent. It defaults to 8080.