Add Dockerfile

This commit is contained in:
TwinProduction
2019-09-14 19:25:59 -04:00
parent 88c35e30b4
commit fb93c33966
5 changed files with 35 additions and 9 deletions

16
Dockerfile Normal file
View File

@ -0,0 +1,16 @@
# Build the go application into a binary
FROM golang:alpine as builder
WORKDIR /app
ADD . ./
RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -installsuffix cgo -o gatus .
RUN apk --update add ca-certificates
# Run the binary on an empty container
FROM scratch
COPY --from=builder /app/gatus .
COPY --from=builder /app/config.yaml .
COPY --from=builder /app/static static/
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
ENV PORT 80
EXPOSE 80
ENTRYPOINT ["/gatus"]