我向我的容器添加了一个新的健康检查,如下所示:
app:
...
labels:
- autoheal=true
healthcheck:
test: ["CMD", 'curl -o /dev/null -s -w "%{http_code}\n" http://localhost:3000/health --connect-timeout 30 --max-time 30 | grep 200']
interval: 30s
timeout: 60s
retries: 3
logging:
driver: "syslog"
options:
syslog-address: "tcp://127.0.0.1:601"
depends_on:
- scalyr
Run Code Online (Sandbox Code Playgroud)
但是当我输入“docker container ls”时,健康检查仍在开始:
“sh run-node” 11 分钟前 5 分钟(运行状况:正在启动)