feat: add healthcheck (#141)

* feat: add healtcheck app

Signed-off-by: rare-magma <rare-magma@posteo.eu>

* feat: add healthz endpoint

Signed-off-by: rare-magma <rare-magma@posteo.eu>

* ci: add healthcheck directive to dockerfile

Signed-off-by: rare-magma <rare-magma@posteo.eu>

---------

Signed-off-by: rare-magma <rare-magma@posteo.eu>
This commit is contained in:
Nuno 2024-07-03 20:40:40 +02:00 committed by GitHub
parent e409176642
commit 6a2ce509c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 129 additions and 11 deletions

View file

@ -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"]