2018-11-06 03:26:37 +00:00
|
|
|
FROM golang:1.11-alpine as base
|
|
|
|
MAINTAINER "Hunter Long (https://github.com/hunterlong)"
|
2018-09-15 02:53:54 +00:00
|
|
|
ARG VERSION
|
2018-11-06 03:26:37 +00:00
|
|
|
ENV DEP_VERSION v0.5.0
|
|
|
|
RUN apk add --no-cache libstdc++ gcc g++ make git ca-certificates linux-headers wget curl jq
|
|
|
|
RUN curl -L -s https://github.com/golang/dep/releases/download/$DEP_VERSION/dep-linux-amd64 -o /go/bin/dep && \
|
|
|
|
chmod +x /go/bin/dep
|
2018-12-18 17:49:02 +00:00
|
|
|
RUN curl -L -s https://assets.statping.com/sass -o /usr/local/bin/sass && \
|
2018-11-06 03:26:37 +00:00
|
|
|
chmod +x /usr/local/bin/sass
|
2018-12-04 04:17:29 +00:00
|
|
|
WORKDIR /go/src/github.com/hunterlong/statping
|
|
|
|
ADD . /go/src/github.com/hunterlong/statping
|
2018-11-06 03:26:37 +00:00
|
|
|
RUN make dep
|
|
|
|
RUN make dev-deps
|
|
|
|
RUN make install
|
|
|
|
|
2018-12-04 05:57:11 +00:00
|
|
|
# Statping :latest Docker Image
|
2018-11-06 03:26:37 +00:00
|
|
|
FROM alpine:latest
|
2018-08-18 02:19:56 +00:00
|
|
|
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-08-16 06:22:20 +00:00
|
|
|
|
2018-11-06 03:26:37 +00:00
|
|
|
RUN apk --no-cache add curl jq
|
|
|
|
|
|
|
|
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
|
|
|
|
EXPOSE 8080
|
2018-11-06 01:34:02 +00:00
|
|
|
|
|
|
|
HEALTHCHECK --interval=5s --timeout=5s --retries=5 CMD curl -s "http://localhost:8080/health" | jq -r -e ".online==true"
|
|
|
|
|
2018-12-04 04:17:29 +00:00
|
|
|
CMD ["statping"]
|