Containerize the monitor with production and dev compose stacks, fix healthchecks and port handling, and make the dashboard base path configurable for direct or proxied access. Co-authored-by: Cursor <cursoragent@cursor.com>
13 lines
303 B
JavaScript
13 lines
303 B
JavaScript
import http from 'http';
|
|
|
|
const port = Number(process.env.PORT) || 3000;
|
|
|
|
const req = http.get(`http://127.0.0.1:${port}/health`, (res) => {
|
|
process.exit(res.statusCode === 200 ? 0 : 1);
|
|
});
|
|
|
|
req.on('error', () => process.exit(1));
|
|
req.setTimeout(4000, () => {
|
|
req.destroy();
|
|
process.exit(1);
|
|
});
|