2019-09-14 19:25:59 -04:00
|
|
|
# Build the go application into a binary
|
2025-03-14 19:33:27 -04:00
|
|
|
FROM golang:alpine AS builder
|
2025-05-31 19:04:50 -04:00
|
|
|
RUN apk --update add ca-certificates
|
2019-09-14 19:25:59 -04:00
|
|
|
WORKDIR /app
|
2020-11-16 17:19:12 +03:00
|
|
|
COPY . ./
|
2025-12-06 23:48:39 +01:00
|
|
|
RUN go mod tidy -diff
|
2022-11-15 21:58:24 -05:00
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gatus .
|
2019-09-14 19:25:59 -04:00
|
|
|
|
2020-11-14 15:55:37 +01:00
|
|
|
# Run Tests inside docker image if you don't have a configured go environment
|
|
|
|
|
#RUN apk update && apk add --virtual build-dependencies build-base gcc
|
|
|
|
|
#RUN go test ./... -mod vendor
|
|
|
|
|
|
2019-09-14 19:25:59 -04:00
|
|
|
# Run the binary on an empty container
|
|
|
|
|
FROM scratch
|
|
|
|
|
COPY --from=builder /app/gatus .
|
2019-12-28 12:55:00 -05:00
|
|
|
COPY --from=builder /app/config.yaml ./config/config.yaml
|
2019-09-14 19:25:59 -04:00
|
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
2024-11-13 23:54:00 -05:00
|
|
|
ENV GATUS_CONFIG_PATH=""
|
|
|
|
|
ENV GATUS_LOG_LEVEL="INFO"
|
|
|
|
|
ENV PORT="8080"
|
2019-12-04 17:10:04 -05:00
|
|
|
EXPOSE ${PORT}
|
2020-11-16 17:19:12 +03:00
|
|
|
ENTRYPOINT ["/gatus"]
|