From 56b635dd9b808e675e0ea3ee70d093a523c95438 Mon Sep 17 00:00:00 2001 From: hunterlong Date: Wed, 6 May 2020 01:32:27 -0700 Subject: [PATCH] GH action --- Dockerfile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index ab67cb1c..be485d89 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,22 @@ +FROM statping/statping:base AS base + +# Statping main Docker image that contains all required libraries FROM alpine:latest -MAINTAINER "Hunter Long (https://github.com/hunterlong)" -ARG VERSION -ARG ARCH +RUN apk --no-cache add libgcc libstdc++ ca-certificates curl jq && update-ca-certificates -RUN apk --no-cache add curl jq - -RUN curl -L -s https://assets.statping.com/sass -o /usr/local/bin/sass && \ - chmod +x /usr/local/bin/sass - -RUN curl -L -O https://github.com/statping/statping/releases/download/v$VERSION/statping-linux-$ARCH.tar.gz && \ - tar -xzf statping-linux-$ARCH.tar.gz && mv statping /usr/local/bin/ && rm -f statping-linux-$ARCH.tar.gz +COPY --from=base /go/bin/statping /usr/local/bin/ +COPY --from=base /usr/local/bin/sass /usr/local/bin/ +COPY --from=base /usr/local/share/ca-certificates /usr/local/share/ WORKDIR /app -VOLUME /app -ENV PORT=8080 +ENV IS_DOCKER=true +ENV SASS=/usr/local/bin/sass ENV STATPING_DIR=/app +ENV PORT=8080 EXPOSE $PORT -HEALTHCHECK --interval=30s --timeout=5s --retries=5 CMD curl -s "http://localhost:$PORT/health" | jq -r -e ".online==true" +HEALTHCHECK --interval=60s --timeout=10s --retries=3 CMD curl -s "http://localhost:$PORT/health" | jq -r -e ".online==true" CMD statping --port $PORT