From 409e78f2f4d98ef639f4242b9bd5b7693a08def1 Mon Sep 17 00:00:00 2001 From: robin Date: Thu, 18 Dec 2025 21:19:08 +0100 Subject: [PATCH] feat: add docker healthcheck for Coolify --- dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dockerfile b/dockerfile index e98f930..a65610a 100644 --- a/dockerfile +++ b/dockerfile @@ -45,6 +45,9 @@ ENV NEXT_TELEMETRY_DISABLED 1 RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs +# Install curl for healthcheck +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* + COPY --from=builder /app/public ./public COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static @@ -55,4 +58,7 @@ EXPOSE 7777 ENV PORT 7777 ENV HOSTNAME "0.0.0.0" +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ + CMD curl -f http://localhost:7777/api/health || exit 1 + CMD ["node", "server.js"] \ No newline at end of file