1
0
Fork 0
mirror of https://github.com/TwiN/gatus.git synced 2024-12-15 17:51:09 +00:00
twin-gatus/Dockerfile

20 lines
668 B
Text
Raw Normal View History

2019-09-14 23:25:59 +00:00
# Build the go application into a binary
FROM golang:alpine as builder
RUN apk --update add ca-certificates
2019-09-14 23:25:59 +00:00
WORKDIR /app
COPY . ./
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gatus .
2019-09-14 23:25:59 +00:00
2020-11-14 14:55:37 +00: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 23:25:59 +00:00
# Run the binary on an empty container
FROM scratch
COPY --from=builder /app/gatus .
COPY --from=builder /app/config.yaml ./config/config.yaml
2019-09-14 23:25:59 +00:00
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
2019-12-04 22:10:04 +00:00
ENV PORT=8080
EXPOSE ${PORT}
ENTRYPOINT ["/gatus"]