mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-11 14:28:56 +00:00
Add healthchecks and test image before push
This commit is contained in:
@@ -60,5 +60,8 @@ EXPOSE 3000
|
||||
ENV PORT 3000
|
||||
ENV NEXT_TELEMETRY_DISABLED 1
|
||||
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=10s \
|
||||
CMD node scripts/healthcheck.js
|
||||
|
||||
|
||||
CMD ["/app/scripts/start.sh"]
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
/* eslint-disable no-console */
|
||||
/* eslint-disable no-undef */
|
||||
const http = require('http');
|
||||
const options = {
|
||||
host: 'localhost',
|
||||
port: 3000,
|
||||
timeout: 2000,
|
||||
path: '/'
|
||||
};
|
||||
|
||||
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(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
healthCheck.end();
|
||||
Reference in New Issue
Block a user