2020-03-04 15:58:42 +00:00
|
|
|
FROM golang:1.14-alpine
|
2020-02-27 10:04:27 +00:00
|
|
|
LABEL maintainer="Hunter Long (https://github.com/hunterlong)"
|
|
|
|
ARG VERSION
|
|
|
|
RUN apk add --update --no-cache libstdc++ gcc g++ make git ca-certificates linux-headers wget curl jq libsass nodejs nodejs-npm
|
|
|
|
RUN npm install -g yarn
|
|
|
|
|
|
|
|
RUN curl -L -s https://assets.statping.com/sass -o /usr/local/bin/sass && \
|
|
|
|
chmod +x /usr/local/bin/sass
|
|
|
|
|
|
|
|
WORKDIR /go/src/github.com/hunterlong/statping
|
|
|
|
|
2020-02-29 15:00:08 +00:00
|
|
|
ADD go.mod go.sum ./
|
2020-02-27 10:04:27 +00:00
|
|
|
|
|
|
|
RUN go mod download
|
2020-02-28 06:37:48 +00:00
|
|
|
|
2020-02-29 15:00:08 +00:00
|
|
|
ENV GO111MODULE on
|
|
|
|
|
2020-03-01 06:57:30 +00:00
|
|
|
RUN go get github.com/stretchr/testify/assert && \
|
|
|
|
go get github.com/stretchr/testify/require && \
|
2020-02-28 06:37:48 +00:00
|
|
|
go get github.com/GeertJohan/go.rice/rice && \
|
2020-02-29 23:36:31 +00:00
|
|
|
go get github.com/cortesi/modd/cmd/modd && \
|
|
|
|
go get github.com/crazy-max/xgo
|
2020-02-27 10:04:27 +00:00
|
|
|
|
|
|
|
ADD frontend/package.json frontend/yarn.lock ./frontend/
|
|
|
|
|
|
|
|
RUN cd frontend && yarn install --pure-lockfile --network-timeout 1000000 && \
|
|
|
|
yarn cache clean
|
|
|
|
|
2020-02-29 15:00:08 +00:00
|
|
|
COPY . ./
|
2020-02-27 10:04:27 +00:00
|
|
|
|
2020-03-01 06:57:30 +00:00
|
|
|
RUN make clean
|
|
|
|
RUN make compile
|
2020-02-27 10:04:27 +00:00
|
|
|
RUN make build
|
|
|
|
RUN chmod a+x statping && mv statping /go/bin/statping
|
|
|
|
|
|
|
|
WORKDIR /app
|