minipaste/Dockerfile

13 lines
360 B
Docker

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
RUN apk add --no-cache curl
COPY --from=builder /app/minipaste /usr/bin/minipaste
HEALTHCHECK --interval=10s --start-period=5s CMD curl --fail http://localhost:8080 || exit 1
CMD ["/usr/bin/minipaste"]