From c0bb215846a87bc9fcbc813baf078f1a7404f7ce Mon Sep 17 00:00:00 2001 From: sai80082 Date: Mon, 16 Mar 2026 13:07:52 +0530 Subject: [PATCH] fix: health check --- Dockerfile | 8 +++++++- docker-compose.yml | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 34a877d..a6992f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,8 @@ ENV VERSION=$VERSION ENV NODE_ENV=production +RUN apk add --no-cache curl + RUN addgroup -g 1001 -S nodejs RUN adduser -S nextjs -u 1001 @@ -52,4 +54,8 @@ ENV PORT=3000 # Uncomment the following line in case you want to disable telemetry. ENV NEXT_TELEMETRY_DISABLED=1 -CMD ["node", "server.js"] \ No newline at end of file +ENV HOSTNAME=0.0.0.0 + +CMD ["node", "server.js"] + +HEALTHCHECK CMD curl --fail http://localhost:3000/api/health || exit 1 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index b11157e..b4ff873 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,8 +9,7 @@ services: env_file: - .env healthcheck: - test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"] interval: 30s timeout: 10s retries: 3 - start_period: 40s + start_period: 10s