容器未响应端口上的 HTTP ping:80,站点启动失败
Container didn't respond to HTTP pings on port: 80, failing site start
我已将 python:3.8-slim-buster 映像部署到应用服务。通常它 运行 是正确的,因为我可以在日志中看到处理,但是健康检查机制尝试 ping 托管服务器但它没有响应,因为它只是 运行 中的代码循环并处理来自队列的消息。
没问题,但应用程序因错误而被终止:
Container didn't respond to HTTP pings on port: 80, failing site start.
Stopping site because it failed during startup.
有没有办法删除此 Waiting for response to warmup request for container
或在 dockerfile 中指定以 OK 响应这些请求?
目前我的 dockerfile 是一个 2 liner,它只复制脚本然后 运行s python 脚本。
复制的
Dockerfile:
FROM python:3.8-slim-buster
COPY ./Scripts .
CMD [ "python3","-u","./calculate.py"]
第一步
在 Dockerfile 中添加 EXPOSE 8080
第 2 步
从 Dockerfile 构建镜像:
docker 构建。 -t python-计算器
第三步
docker images #使用您之前提到的标签搜索图像,即 python-calculator
第四步
docker 运行 -p 8080:8080 -d
第五步
本地主机:8080
解决方法是将脚本托管在服务器中,例如nodejs 或给定语言的等价物,或创建单独的进程,将 return 用于 80 端口的东西。
默认配置的端口也可能存在问题,以下是解决该问题的答案:
https://serverfault.com/questions/1003418/azure-docker-app-error-site-did-not-start-within-expected-time-limit-and-co
我已将 python:3.8-slim-buster 映像部署到应用服务。通常它 运行 是正确的,因为我可以在日志中看到处理,但是健康检查机制尝试 ping 托管服务器但它没有响应,因为它只是 运行 中的代码循环并处理来自队列的消息。 没问题,但应用程序因错误而被终止:
Container didn't respond to HTTP pings on port: 80, failing site start.
Stopping site because it failed during startup.
有没有办法删除此 Waiting for response to warmup request for container
或在 dockerfile 中指定以 OK 响应这些请求?
目前我的 dockerfile 是一个 2 liner,它只复制脚本然后 运行s python 脚本。
复制的Dockerfile:
FROM python:3.8-slim-buster
COPY ./Scripts .
CMD [ "python3","-u","./calculate.py"]
第一步
在 Dockerfile 中添加 EXPOSE 8080
第 2 步
从 Dockerfile 构建镜像:
docker 构建。 -t python-计算器
第三步
docker images #使用您之前提到的标签搜索图像,即 python-calculator
第四步
docker 运行 -p 8080:8080 -d
第五步
本地主机:8080
解决方法是将脚本托管在服务器中,例如nodejs 或给定语言的等价物,或创建单独的进程,将 return 用于 80 端口的东西。
默认配置的端口也可能存在问题,以下是解决该问题的答案: https://serverfault.com/questions/1003418/azure-docker-app-error-site-did-not-start-within-expected-time-limit-and-co