github.com/paulwerner/bookkeeper@v0.1.0/Dockerfile (about) 1 FROM golang:1.18.1-alpine AS builder 2 3 ENV CGO_ENABLED=0 \ 4 GOOS=linux \ 5 GARCH=amd64 6 7 WORKDIR /build 8 9 COPY go.mod go.sum ./ 10 RUN go mod download 11 12 COPY . . 13 14 RUN go build -o main ./cmd/bookkeeper-api/main.go 15 16 WORKDIR /dist 17 18 RUN cp /build/main . 19 RUN cp -r /build/ops.migrations/ . 20 RUN cp /build/app.env . 21 22 FROM scratch 23 24 COPY --from=builder /dist/ / 25 EXPOSE 8080 26 ENTRYPOINT [ "./main" ]