mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-01-02 19:20:54 -05:00
Docker healthcheck
Copied from https://scoutapm.com/blog/how-to-use-docker-healthcheck
This commit is contained in:
parent
78f5d2cd8b
commit
c203317b3b
19
extra/healthcheck.js
Normal file
19
extra/healthcheck.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
var http = require("http");
|
||||||
|
var options = {
|
||||||
|
host: "localhost",
|
||||||
|
port: "3001",
|
||||||
|
timeout: 2000,
|
||||||
|
};
|
||||||
|
var request = http.request(options, (res) => {
|
||||||
|
console.log(`STATUS: ${res.statusCode}`);
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
process.exit(0);
|
||||||
|
} else {
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
request.on("error", function (err) {
|
||||||
|
console.log("ERROR");
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
request.end();
|
Loading…
Reference in New Issue
Block a user