add Dockerfile, closes #6

This commit is contained in:
dhax 2020-01-30 15:11:21 +01:00
parent 069d655d9c
commit c170a1d2e7

19
Dockerfile Normal file
View file

@ -0,0 +1,19 @@
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"]