mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-17 02:09:49 +00:00
Update Dockerfile and add healthcheck
This commit is contained in:
parent
78c52861c7
commit
fb845c3e03
2 changed files with 30 additions and 4 deletions
19
healthcheck.js
Executable file
19
healthcheck.js
Executable file
|
@ -0,0 +1,19 @@
|
|||
var http = require("http");
|
||||
var options = {
|
||||
host: "localhost",
|
||||
port: "3000",
|
||||
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…
Add table
Add a link
Reference in a new issue