add Dockerfile, closes #6
This commit is contained in:
parent
069d655d9c
commit
c170a1d2e7
1 changed files with 19 additions and 0 deletions
19
Dockerfile
Normal file
19
Dockerfile
Normal 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"]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue