Skip to content

Commit

Permalink
docker: fix healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Divkix committed Jun 9, 2023
1 parent d8a518c commit dfb2a0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ RUN upx --brute out/aliveimage

# Final Stage: Use a smaller base image and only include necessary files
FROM alpine
RUN apk add --no-cache tini
COPY --from=builder /app/out/aliveimage /app/aliveimage
ENV API_LISTEN_PORT=8080
EXPOSE $API_LISTEN_PORT
ENTRYPOINT ["/sbin/tini", "--", "/app/aliveimage"]
ENTRYPOINT ["/app/aliveimage"]

HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD curl --fail http://localhost:$API_LISTEN_PORT/status || exit 1

Expand Down
7 changes: 4 additions & 3 deletions goreleaser.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM alpine
RUN apk add --no-cache tini curl
COPY aliveimage /
ENTRYPOINT ["/sbin/tini", "--", "/aliveimage"]
RUN apk add --no-cache curl
COPY aliveimage /app/aliveimage
ENV API_LISTEN_PORT=8080
EXPOSE $API_LISTEN_PORT
ENTRYPOINT ["/app/aliveimage"]

HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD curl --fail http://localhost:$API_LISTEN_PORT/status || exit 1

Expand Down

0 comments on commit dfb2a0b

Please sign in to comment.