From 5c499c87abe4e661054eaf9d7336a6b4dc56bee0 Mon Sep 17 00:00:00 2001 From: Tobias Stadler <28538704+devtobi@users.noreply.github.com> Date: Sat, 9 Sep 2023 00:46:43 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=BA=20=20Added=20healthcheck=20to=20im?= =?UTF-8?q?age=20and=20ARG=20for=20port?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d6b154294..68fa85489 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ FROM node:20-alpine WORKDIR /app +ARG PORT=7575 + ENV NEXT_TELEMETRY_DISABLED 1 ENV NODE_ENV production ENV NODE_OPTIONS '--no-experimental-fetch' @@ -14,8 +16,10 @@ COPY package.json ./package.json COPY .next/standalone ./ COPY .next/static ./.next/static -EXPOSE 7575 +EXPOSE $PORT +ENV PORT=${PORT} -ENV PORT 7575 +HEALTHCHECK --interval=10s --timeout=5s --start-period=5s --retries=3 \ + CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT} || exit 1 -CMD ["node", "server.js"] +CMD ["node", "server.js"] \ No newline at end of file