Skip to content

Commit

Permalink
add labels and healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Divkix committed May 24, 2023
1 parent b7ec688 commit 3c9d840
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,15 @@ RUN CGO_ENABLED=0 GOOS=`go env GOHOSTOS` GOARCH=`go env GOHOSTARCH` go build -o
# Final Stage: Use a smaller base image and only include necessary files
FROM scratch
COPY --from=builder /app/out/aliveimage /app/aliveimage
EXPOSE 8080
ENV API_LISTEN_PORT=8080
EXPOSE $API_LISTEN_PORT
CMD ["/app/aliveimage"]

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

LABEL org.opencontainers.image.authors="Divanshu Chauhan <me@divkix.me>"
LABEL org.opencontainers.image.url="https://divkix.me"
LABEL org.opencontainers.image.source="https://github.com/divkix/aliveimage"
LABEL org.opencontainers.image.title="Alive Image"
LABEL org.opencontainers.image.description="Basic go app & docker image with simple json response."
LABEL org.opencontainers.image.vendor="Divkix"

0 comments on commit 3c9d840

Please sign in to comment.