Skip to content

Commit

Permalink
add healthcheck to Dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
stv0g committed Jun 10, 2022
1 parent c98ee95 commit 00cfdb0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN npm run build

FROM alpine:3.15

RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
RUN apk update && apk add ca-certificates curl && rm -rf /var/cache/apk/*

COPY --from=frontend-builder /app/dist/ /dist/
COPY --from=backend-builder /app/gose /
Expand All @@ -36,4 +36,9 @@ COPY --from=backend-builder /app/config.yaml /
ENV GIN_MODE=release
ENV GOSE_SERVER_STATIC=/dist

EXPOSE 8080/tcp

HEALTHCHECK --interval=30s --timeout=30s --retries=3 \
CMD curl -f http://localhost:8080/api/v1/healthz

ENTRYPOINT [ "/gose" ]
7 changes: 6 additions & 1 deletion Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
FROM alpine:3.15

RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
RUN apk update && apk add ca-certificates curl && rm -rf /var/cache/apk/*

ENV GIN_MODE=release

EXPOSE 8080/tcp

HEALTHCHECK --interval=30s --timeout=30s --retries=3 \
CMD curl -f http://localhost:8080/api/v1/healthz

COPY gose /

ENTRYPOINT ["/gose"]

0 comments on commit 00cfdb0

Please sign in to comment.