Update healthcheck to work with PORT variable
This commit is contained in:
parent
fb845c3e03
commit
36d1a9c738
2 changed files with 8 additions and 4 deletions
|
@ -54,9 +54,10 @@ COPY --link /public ./public
|
|||
COPY --link --from=builder /app/.next/standalone ./
|
||||
COPY --link --from=builder /app/.next/static/ ./.next/static/
|
||||
|
||||
EXPOSE 3000
|
||||
ENV PORT='3000'
|
||||
|
||||
HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \
|
||||
CMD node ./healthcheck.js
|
||||
|
||||
EXPOSE 3000
|
||||
ENV PORT 3000
|
||||
CMD ["node", "server.js"]
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
var http = require("http");
|
||||
|
||||
const PORT = process.env.PORT || "3000";
|
||||
|
||||
var options = {
|
||||
host: "localhost",
|
||||
port: "3000",
|
||||
port: PORT,
|
||||
timeout: 2000,
|
||||
};
|
||||
var request = http.request(options, (res) => {
|
||||
|
@ -16,4 +19,4 @@ request.on("error", function (err) {
|
|||
console.log("ERROR");
|
||||
process.exit(1);
|
||||
});
|
||||
request.end();
|
||||
request.end();
|
||||
|
|
Loading…
Add table
Reference in a new issue