diff --git a/Dockerfile b/Dockerfile index a754bd94..5c4e8334 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,14 @@ -FROM statping/statping:base AS base - -# Statping main Docker image that contains all required libraries FROM alpine:latest -RUN apk --no-cache add libgcc libstdc++ ca-certificates curl jq && update-ca-certificates +ARG VERSION +ARG ARCH -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/ +RUN apk --no-cache add curl jq libsass linux-headers ca-certificates + +RUN curl -L -s https://assets.statping.com/sass -o /usr/local/bin/sass && \ + chmod +x /usr/local/bin/sass + +RUN curl -fsSL https://github.com/statping/statping/releases/download/v$VERSION/statping-linux-$ARCH.tar.gz -o statping.tar.gz && \ + tar -C /usr/local/bin -xzf statping.tar.gz && rm statping.tar.gz WORKDIR /app @@ -19,4 +21,3 @@ EXPOSE $PORT HEALTHCHECK --interval=60s --timeout=10s --retries=3 CMD curl -s "http://localhost:$PORT/health" | jq -r -e ".online==true" CMD statping --port $PORT -