From afe7cb4163af478bbb66633c5a974f81e3fe8f42 Mon Sep 17 00:00:00 2001 From: rare-magma Date: Sat, 29 Jun 2024 13:21:25 +0200 Subject: [PATCH] ci: add healthcheck directive to dockerfile Signed-off-by: rare-magma --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index df6bb71..dddfe66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,15 +11,18 @@ COPY . . ENV CGO_ENABLED=0 -RUN go build -o anonymousoverflow +RUN go build -o anonymousoverflow && go build -o healthcheck ./src/healthcheck FROM scratch COPY --from=build /app/anonymousoverflow /anonymousoverflow +COPY --from=build /app/healthcheck /healthcheck COPY templates /templates COPY public /public COPY --from=build /etc/ssl/certs /etc/ssl/certs +HEALTHCHECK --interval=60s --timeout=5s --start-period=2s --retries=3 CMD [ "/healthcheck","http://localhost:8080/healthz" ] + EXPOSE 8080 CMD ["/anonymousoverflow"] \ No newline at end of file