成功部署Dockerized应用程序,但在预热和

时间:2020-01-18 20:46:19

标签: python azure docker flask azure-web-app-service

我有一个泊坞程序化的应用程序,可以很好地部署在Azure应用程序服务上。然后,我对html文件进行了一些更改,将新版本推送到dockerhub,最后将azure设置为提取最新标签。但是,现在该应用程序停止了全部协同工作。我删除了天蓝色的资源和服务,并尝试重新创建它们。这是该过程:

creating the web app

adding docker registry

容器的日志流如下:

2020-01-18T20:21:10.830911857Z  * Serving Flask app "main" (lazy loading)
2020-01-18T20:21:10.834294374Z  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
2020-01-18 20:31:41.719 INFO  - Pulling image from Docker hub: gdeol4/azure-ml:version-8
2020-01-18 20:31:41.837 INFO  - version-8 Pulling from xyz
2020-01-18 20:31:41.839 INFO  -  Digest: sha256:xyz
2020-01-18 20:31:41.840 INFO  -  Status: Image is up to date for xyz
2020-01-18 20:31:41.845 INFO  - Pull Image successful, Time taken: 0 Minutes and 0 Seconds
2020-01-18 20:31:41.858 INFO  - Starting container for site docker run -d -p 2113:80
-e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false
-e PORT=80
-e WEBSITE_ROLE_INSTANCE_ID=0
-e HTTP_LOGGING_ENABLED=1

2020-01-18 20:31:42.337 INFO  - Initiating warmup request to container
2020-01-18 20:35:32.524 ERROR - Container xyz for site xyz did not start within expected time limit. Elapsed time = 230.1865177 sec
2020-01-18 20:35:32.525 ERROR - Container xyz didn't respond to HTTP pings on port: 80, failing site start. See container logs for debugging.
2020-01-18 20:35:32.535 INFO  - Stoping site because it failed during startup.

1 个答案:

答案 0 :(得分:1)

在这种情况下,解决方案是使用WEBSITES_PORT应用程序设置并将其设置为5000(应用程序用来侦听请求的端口)。