Add healthcheck
This commit is contained in:
17
Dockerfile
17
Dockerfile
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user