A continuation of HomeBox the inventory and organization system built for the Home User
Add Dockerfile healthcheck
Katos5a015b95810c
diff --git a/Dockerfile.rootless b/Dockerfile.rootlessindex bfa056ee..32d21ff8 100644--- a/Dockerfile.rootless+++ b/Dockerfile.rootless@@ -13,6 +13,7 @@ FROM golang:alpine AS builderARG BUILD_TIMEARG COMMITARG VERSION+ARG BUSYBOX_VERSION=1.36.1-r31RUN apk update && \apk upgrade && \apk add --update git build-base gcc g++@@ -30,6 +31,14 @@ RUN CGO_ENABLED=0 GOOS=linux go build \# create a directory so that we can copy it in the next stagemkdir /data+# Downloading Wget+ADD https://busybox.net/downloads/binaries/$BUSYBOX_VERSION/busybox_WGET /wget+RUN chmod a+x /wget++FROM gcr.io/distroless/java++COPY --from=builder /wget /usr/bin/wget+# Production StageFROM gcr.io/distroless/static@@ -41,10 +50,16 @@ ENV HBOX_STORAGE_SQLITE_URL=/data/homebox.db?_fk=1# change the ownership to the low-privileged userCOPY --from=builder --chown=nonroot /go/bin/api /appCOPY --from=builder --chown=nonroot /data /data+COPY --from=builder --chown=nonroot /wget /usr/bin/wgetLABEL Name=homebox Version=0.0.1LABEL org.opencontainers.image.source="https://github.com/sysadminsmedia/homebox"EXPOSE 7745+HEALTHCHECK --interval=30s \+ --timeout=5s \+ --start-period=5s \+ --retries=3 \+ CMD [ "/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:7745/api/v1/status" ]VOLUME [ "/data" ]# Drop root and run as low-privileged user