Add healthcheck

This commit is contained in:
Ben Sarmiento
2023-11-07 10:25:19 +01:00
parent e2a2d2caa6
commit a7d7c4ae0d

View File

@@ -9,15 +9,20 @@ COPY . .
RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags="-s -w" -o zurg cmd/zurg/main.go
# Obfuscation stage
# FROM alpine:3 AS obfuscator
# WORKDIR /app
# COPY --from=builder /app/zurg .
# RUN apk add --no-cache upx
# RUN upx --brute zurg
FROM alpine:3 AS obfuscator
WORKDIR /app
COPY --from=builder /app/zurg .
RUN apk add --no-cache upx
RUN upx --brute zurg
# Final stage
FROM alpine:3
WORKDIR /app
COPY --from=builder /app/zurg .
COPY --from=obfuscator /app/zurg .
RUN apk add --no-cache fuse3
# Healthcheck to verify that port 9999 is available to accept connections
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD nc -z localhost 9999 || exit 1
ENTRYPOINT ["./zurg"]