From 748c30ab8c258628beb64ff8ff60aa53022febd2 Mon Sep 17 00:00:00 2001 From: ats-tech25 Date: Fri, 7 Nov 2025 21:53:07 +0000 Subject: [PATCH] chore(docker): Enhance Dockerfile with improved healthcheck and package installation - Add wget package to base Alpine image for healthcheck functionality - Increase healthcheck start period from 5s to 40s to allow more startup time - Ensure robust health verification for application container - Improve container initialization and readiness detection --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 84eecc9..1f9f723 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,8 +25,8 @@ RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o cli cmd/cli/main. # Runtime stage FROM alpine:latest -# Install ca-certificates for HTTPS requests -RUN apk --no-cache add ca-certificates tzdata +# Install ca-certificates for HTTPS requests and wget for healthcheck +RUN apk --no-cache add ca-certificates tzdata wget WORKDIR /root/ @@ -40,8 +40,8 @@ COPY --from=builder /app/internal/templates ./internal/templates # Expose port (adjust if needed) EXPOSE 8080 -# Health check -HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ +# Health check - give more time for startup +HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1 # Run the server