mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-26 10:43:35 +02:00
add react-express-mysql application sample
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
This commit is contained in:
parent
0d06c37791
commit
43f21f2d8d
46 changed files with 4786 additions and 0 deletions
21
samples/react-express-mysql/backend/healthcheck.js
vendored
Executable file
21
samples/react-express-mysql/backend/healthcheck.js
vendored
Executable file
|
@ -0,0 +1,21 @@
|
|||
var http = require("http");
|
||||
|
||||
var options = {
|
||||
timeout: 2000,
|
||||
host: 'localhost',
|
||||
port: process.env.PORT || 8080,
|
||||
path: '/healthz' // must be the same as HEALTHCHECK in Dockerfile
|
||||
};
|
||||
|
||||
var request = http.request(options, (res) => {
|
||||
console.info('STATUS: ' + res.statusCode);
|
||||
process.exitCode = (res.statusCode === 200) ? 0 : 1;
|
||||
process.exit();
|
||||
});
|
||||
|
||||
request.on('error', function(err) {
|
||||
console.error('ERROR', err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
request.end();
|
Loading…
Add table
Add a link
Reference in a new issue