为什么 Python 应用程序无法部署?

从源构建 Python 应用程序时,映像会构建并在 Container Registry中可视。 但是,应用程序无法部署。

从 buildpack 构建 Python 时, buildpack 不会提供定义启动过程的方法。 缺省情况下,它将启动过程设置为 python,这将启动正确版本的 REPL。 要运行 Python 程序,可以使用 Procfile 机制来覆盖缺省启动过程: web

以下 Procfile 将生成的映像的 entrypoint 设置为 main.py ,并且必须存在于上下文目录的根目录中。

web: python main.py