diff --git a/Dockerfile b/Dockerfile index 0a2073a..8524549 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,8 +19,8 @@ RUN npm run build # Production stage - Use a simple server that works with Coolify FROM node:18-alpine AS production -# Install serve package -RUN npm install -g serve +# Install curl and serve package +RUN apk add --no-cache curl && npm install -g serve # Set working directory WORKDIR /app @@ -39,5 +39,9 @@ USER nextjs # Expose port 3000 (Coolify default) EXPOSE 3000 +# Add healthcheck +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ + CMD curl -f http://localhost:3000/ || exit 1 + # Start the server CMD ["serve", "-s", "dist", "-l", "3000"] \ No newline at end of file