@@ -10,18 +10,18 @@ RUN yarn build && yarn cache clean
1010
1111# Statping Golang BACKEND building from source
1212# Creates "/go/bin/statping" and "/usr/local/bin/sass" for copying
13- FROM golang:1.17 -alpine AS backend
13+ FROM golang:1.20.0 -alpine AS backend
1414LABEL maintainer="Statping-NG (https://github.com/statping-ng)"
1515ARG VERSION
1616ARG COMMIT
1717ARG BUILDPLATFORM
1818ARG TARGETARCH
19- RUN apk add --update -- no-cache libstdc++ gcc g++ make git autoconf \
19+ RUN apk add --no-cache libstdc++ gcc g++ make git autoconf \
2020 libtool ca-certificates linux-headers wget curl jq && \
2121 update-ca-certificates
2222
2323WORKDIR /root
24- RUN git clone https://github.com/sass/sassc.git
24+ RUN git clone --depth 1 --branch 3.6.2 https://github.com/sass/sassc.git
2525RUN . sassc/script/bootstrap && make -C sassc -j4
2626# sassc binary: /root/sassc/bin/sassc
2727
@@ -30,15 +30,17 @@ ADD go.mod go.sum ./
3030RUN go mod download
3131ENV GO111MODULE on
3232ENV CGO_ENABLED 1
33- RUN go get github.com/stretchr/testify/assert && \
34- go get github.com/stretchr/testify/require && \
35- go get github.com/GeertJohan/go.rice/rice && \
36- go get github.com/cortesi/modd/cmd/modd && \
37- go get github.com/crazy-max/xgo
38- COPY . .
33+ COPY cmd ./cmd
34+ COPY database ./database
35+ COPY handlers ./handlers
36+ COPY notifiers ./notifiers
37+ COPY source ./source
38+ COPY types ./types
39+ COPY utils ./utils
3940COPY --from=frontend /statping/dist/ ./source/dist/
40- RUN make clean generate embed
41- RUN go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION} -X main.COMMIT=${COMMIT}" -o statping --tags "netgo linux" ./cmd
41+ RUN go install github.com/GeertJohan/go.rice/rice@latest
42+ RUN cd source && rice embed-go
43+ RUN go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=$VERSION -X main.COMMIT=$COMMIT" -o statping --tags "netgo linux" ./cmd
4244RUN chmod a+x statping && mv statping /go/bin/statping
4345# /go/bin/statping - statping binary
4446# /root/sassc/bin/sassc - sass binary
@@ -64,6 +66,6 @@ ENV BASE_PATH=""
6466
6567EXPOSE $PORT
6668
67- HEALTHCHECK --interval=60s --timeout=10s --retries=3 CMD if [ -z "$BASE_PATH" ]; then HEALTHPATH="/health" ; else HEALTHPATH="/$BASE_PATH/health" ; fi && curl -s "http://localhost:80 $HEALTHPATH" | jq -r -e ".online==true"
69+ HEALTHCHECK --interval=60s --timeout=10s --retries=3 CMD if [ -z "$BASE_PATH" ]; then HEALTHPATH="/health" ; else HEALTHPATH="/$BASE_PATH/health" ; fi && curl -s "http://localhost:${PORT} $HEALTHPATH" | jq -r -e ".online==true"
6870
6971CMD statping --port $PORT
0 commit comments