我像这样给我的容器添加了一个新的健康检查:
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
我输入"docker container ls"时,健康检查仍在启动中:
"sh run-node" 11分钟前 上线5分钟 (健康状态:启动中)