mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 12:49:43 +02:00
feat: Add healthcheck for docker deployments
fix: Missing healthcheck.js fix: missing healthcheck.js fix: HEALTHCHECK command
This commit is contained in:
parent
77ba21c4a7
commit
2ceeb0a71a
4 changed files with 50 additions and 22 deletions
23
healthcheck.js
Normal file
23
healthcheck.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
const http = require('http');
|
||||
const options = {
|
||||
host: 'localhost',
|
||||
port: 1337,
|
||||
timeout: 2000
|
||||
};
|
||||
|
||||
const healthCheck = http.request(options, (res) => {
|
||||
console.log(`HEALTHCHECK STATUS: ${res.statusCode}`);
|
||||
if (res.statusCode == 200) {
|
||||
process.exit(0);
|
||||
}
|
||||
else {
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
healthCheck.on('error', function (err) {
|
||||
console.error('ERROR');
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
healthCheck.end();
|
Loading…
Add table
Add a link
Reference in a new issue