mirror of https://github.com/statping/statping
improve docker cachability
parent
b46ce4a14b
commit
09ffab4055
|
@ -441,6 +441,7 @@ jobs:
|
||||||
args: |
|
args: |
|
||||||
COMMIT=${{ github.sha }}
|
COMMIT=${{ github.sha }}
|
||||||
VERSION=${{ needs.data.outputs.version }}
|
VERSION=${{ needs.data.outputs.version }}
|
||||||
|
BUILDKIT_INLINE_CACHE=true
|
||||||
|
|
||||||
# all other release jobs should be based on this
|
# all other release jobs should be based on this
|
||||||
release:
|
release:
|
||||||
|
|
12
Dockerfile
12
Dockerfile
|
@ -10,9 +10,6 @@ RUN yarn build && yarn cache clean
|
||||||
|
|
||||||
# Statping Golang BACKEND building from source
|
# Statping Golang BACKEND building from source
|
||||||
# Creates "/go/bin/statping" and "/usr/local/bin/sass" for copying
|
# Creates "/go/bin/statping" and "/usr/local/bin/sass" for copying
|
||||||
# TODO something here breaks caching / forces a rebuild each time. fix
|
|
||||||
# * probably the COPY . .
|
|
||||||
# * also, the sass git clone isn't reproducible, we should version-pin that
|
|
||||||
FROM golang:1.19-alpine AS backend
|
FROM golang:1.19-alpine AS backend
|
||||||
LABEL maintainer="Statping-NG (https://github.com/statping-ng)"
|
LABEL maintainer="Statping-NG (https://github.com/statping-ng)"
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
|
@ -24,7 +21,7 @@ RUN apk add --update --no-cache libstdc++ gcc g++ make git autoconf \
|
||||||
update-ca-certificates
|
update-ca-certificates
|
||||||
|
|
||||||
WORKDIR /root
|
WORKDIR /root
|
||||||
RUN git clone https://github.com/sass/sassc.git
|
RUN git clone --depth 1 --branch 3.6.2 https://github.com/sass/sassc.git
|
||||||
RUN . sassc/script/bootstrap && make -C sassc -j4
|
RUN . sassc/script/bootstrap && make -C sassc -j4
|
||||||
# sassc binary: /root/sassc/bin/sassc
|
# sassc binary: /root/sassc/bin/sassc
|
||||||
|
|
||||||
|
@ -33,7 +30,12 @@ ADD go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
ENV GO111MODULE on
|
ENV GO111MODULE on
|
||||||
ENV CGO_ENABLED 1
|
ENV CGO_ENABLED 1
|
||||||
COPY . .
|
COPY cmd ./cmd
|
||||||
|
COPY database ./database
|
||||||
|
COPY handlers ./handlers
|
||||||
|
COPY source ./source
|
||||||
|
COPY types ./types
|
||||||
|
COPY utils ./utils
|
||||||
COPY --from=frontend /statping/dist/ ./source/dist/
|
COPY --from=frontend /statping/dist/ ./source/dist/
|
||||||
RUN go install github.com/GeertJohan/go.rice/rice@latest
|
RUN go install github.com/GeertJohan/go.rice/rice@latest
|
||||||
RUN cd source && rice embed-go
|
RUN cd source && rice embed-go
|
||||||
|
|
Loading…
Reference in New Issue