我们想在 IBM Bluemix 中部署现有应用程序。我们使用 Python 命令提示符在 IBM Bluemix 中推送了应用程序,但是当我们在 IBM 中部署它时,它无法运行。它给出了以下错误:
Creating container Successfully created container Downloading app package... Downloaded app package (1.5K) Staging... Downloaded build artifacts cache (31.3M) None of the buildpacks detected a compatible application Exit status 222 Staging failed: Exited with status 222 Destroying container
FAILED Error restarting application: NoAppDetectedError TIP: Buildpacks are detected when the "cf push" is executed from within the directory that contains the app source code.
Use 'cf buildpacks' to see a list of supported buildpacks.
Use 'cf logs glucose_tracker_monitor --recent' for more in depth log information.
Finished: FAILED
这之后我不知道该怎么办。谁能帮我解决这些错误?
最佳答案
消息“没有任何 buildpack 检测到兼容的应用程序”意味着 Bluemix 中安装的 buildpack 都没有将您的项目识别为它们可以运行的项目。
来自 Python buildpack 的 Bluemix 文档,您的应用程序需要包含“setup.py”或“requirements.txt”文件,以使此 buildpack“检测”您的应用程序可以运行。
“requirements.txt”文件用于指定您的应用程序需要安装的任何 pip 包。有关示例,请参阅 requirements.txt “IBM-Bluemix”GitHub 存储库中“get-started-python”项目中的文件。
您的应用程序还应包含一个名为“Procfile”的文件,该文件将指定构建包应如何启动您的应用程序。
示例“Procfile”:
web: python hello.py
这会导致 buildpack 在启动应用程序时运行命令 python hello.py
。
关于python - IBM Bluemix 中的 Web 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42958740/