2022-04-20 00:41:57 +00:00
|
|
|
FROM golang:alpine as builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod .
|
|
|
|
COPY go.sum .
|
|
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
RUN go build -o minipaste minipaste.go
|
|
|
|
|
|
|
|
FROM alpine:latest
|
2022-04-20 16:59:54 +00:00
|
|
|
RUN apk add --no-cache curl
|
2022-04-20 00:41:57 +00:00
|
|
|
COPY --from=builder /app/minipaste /usr/bin/minipaste
|
2022-04-20 16:59:54 +00:00
|
|
|
HEALTHCHECK --interval=10s --start-period=5s CMD curl --fail http://localhost:8080 || exit 1
|
2022-04-20 00:41:57 +00:00
|
|
|
CMD ["/usr/bin/minipaste"]
|