From aff02c2defd0e391a8fff07a5fb68e0a59c884d6 Mon Sep 17 00:00:00 2001 From: Luca Crema Date: Fri, 18 Oct 2024 14:07:24 +0200 Subject: [PATCH 1/2] Added HEALTHCHECK to Dockerfile --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index e4019ba..9e96b95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,9 @@ RUN CGO_ENABLED=0 go build . FROM alpine:3.20 +HEALTHCHECK --timeout=10s --start-period=60s --interval=60s \ + CMD wget --spider -q http://localhost:8080/api/healthz + WORKDIR /app COPY --from=builder /app/glance . From 80331aa21700bd939a60374138311db427c50a53 Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Thu, 5 Dec 2024 13:31:25 +0000 Subject: [PATCH 2/2] Also add healthcheck to the other Dockerfile --- Dockerfile | 6 +++--- Dockerfile.goreleaser | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9e96b95..09c9cff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,11 @@ RUN CGO_ENABLED=0 go build . FROM alpine:3.20 -HEALTHCHECK --timeout=10s --start-period=60s --interval=60s \ - CMD wget --spider -q http://localhost:8080/api/healthz - WORKDIR /app COPY --from=builder /app/glance . +HEALTHCHECK --timeout=10s --start-period=60s --interval=60s \ + CMD wget --spider -q http://localhost:8080/api/healthz + EXPOSE 8080/tcp ENTRYPOINT ["/app/glance"] diff --git a/Dockerfile.goreleaser b/Dockerfile.goreleaser index dec9ac4..6b48bad 100644 --- a/Dockerfile.goreleaser +++ b/Dockerfile.goreleaser @@ -3,6 +3,8 @@ FROM alpine:3.20 WORKDIR /app COPY glance . -EXPOSE 8080/tcp +HEALTHCHECK --timeout=10s --start-period=60s --interval=60s \ + CMD wget --spider -q http://localhost:8080/api/healthz +EXPOSE 8080/tcp ENTRYPOINT ["/app/glance"]