2019-12-28 09:39:35 +00:00
|
|
|
FROM golang:1.13.5-alpine as base
|
2019-04-20 03:50:19 +00:00
|
|
|
LABEL maintainer="Hunter Long (https://github.com/hunterlong)"
|
2018-09-15 02:53:54 +00:00
|
|
|
ARG VERSION
|
2020-02-04 02:51:57 +00:00
|
|
|
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
|
2019-03-04 14:25:11 +00:00
|
|
|
RUN curl -L -s https://assets.statping.com/sass -o /usr/local/bin/sass && \
|
|
|
|
chmod +x /usr/local/bin/sass
|
2018-12-04 04:17:29 +00:00
|
|
|
WORKDIR /go/src/github.com/hunterlong/statping
|
2019-12-28 09:01:07 +00:00
|
|
|
ADD Makefile go.mod /go/src/github.com/hunterlong/statping/
|
2019-11-22 19:20:19 +00:00
|
|
|
RUN go mod vendor && \
|
2019-03-20 23:43:15 +00:00
|
|
|
make dev-deps
|
|
|
|
ADD . /go/src/github.com/hunterlong/statping
|
2020-02-21 05:36:23 +00:00
|
|
|
RUN cd frontend && yarn install --network-timeout 1000000
|
2020-02-04 02:51:57 +00:00
|
|
|
RUN make compile install
|
2018-11-06 03:26:37 +00:00
|
|
|
|
2018-12-04 05:57:11 +00:00
|
|
|
# Statping :latest Docker Image
|
2018-11-06 03:26:37 +00:00
|
|
|
FROM alpine:latest
|
2019-04-20 03:50:19 +00:00
|
|
|
LABEL maintainer="Hunter Long (https://github.com/hunterlong)"
|
2018-08-16 06:22:20 +00:00
|
|
|
|
2018-11-06 03:26:37 +00:00
|
|
|
ARG VERSION
|
2018-08-16 06:22:20 +00:00
|
|
|
ENV IS_DOCKER=true
|
2018-12-04 05:57:11 +00:00
|
|
|
ENV STATPING_DIR=/app
|
2018-12-20 03:52:53 +00:00
|
|
|
ENV PORT=8080
|
2019-03-04 15:48:08 +00:00
|
|
|
RUN apk --no-cache add curl jq libsass
|
2018-11-06 03:26:37 +00:00
|
|
|
|
2019-03-04 14:25:11 +00:00
|
|
|
COPY --from=base /usr/local/bin/sass /usr/local/bin/sass
|
2018-12-04 04:17:29 +00:00
|
|
|
COPY --from=base /go/bin/statping /usr/local/bin/statping
|
2018-11-06 03:26:37 +00:00
|
|
|
|
2018-08-16 06:22:20 +00:00
|
|
|
WORKDIR /app
|
|
|
|
VOLUME /app
|
2018-12-20 03:52:53 +00:00
|
|
|
EXPOSE $PORT
|
2018-11-06 01:34:02 +00:00
|
|
|
|
2020-01-13 04:46:15 +00:00
|
|
|
HEALTHCHECK --interval=60s --timeout=10s --retries=3 CMD curl -s "http://localhost:$PORT/health" | jq -r -e ".online==true"
|
2018-11-06 01:34:02 +00:00
|
|
|
|
2018-12-20 04:29:38 +00:00
|
|
|
CMD statping -port $PORT
|