Go-Back-Skeleton/Dockerfile
2020-01-30 15:11:21 +01:00

19 lines
No EOL
459 B
Docker

FROM golang:alpine AS builder
# Add source code
ADD ./ /go/src/github.com/dhax/go-base/
RUN cd /go/src/github.com/dhax/go-base && \
go build && \
mv ./go-base /usr/bin/go-base
# Multi-Stage production build
FROM alpine
RUN apk add --update ca-certificates
# Retrieve the binary from the previous stage
COPY --from=builder /usr/bin/go-base /usr/local/bin/go-base
# Set the binary as the entrypoint of the container
CMD ["go-base", "serve"]