diff --git a/Dockerfile b/Dockerfile index c8b0a44..a5d89f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM node:20-alpine AS builder -RUN apk add --no-cache yarn +RUN apk add --no-cache yarn curl WORKDIR /app @@ -20,7 +20,7 @@ WORKDIR /app RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs -ENV NODE_ENV production +ENV NODE_ENV=production USER nextjs @@ -30,4 +30,7 @@ COPY --from=builder /app/.next/static ./.next/static EXPOSE 3000 +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=5 \ + CMD curl -f http://localhost:3000 || exit 1 + CMD ["node", "server.js"] \ No newline at end of file