Skip to content

Commit 7ad93cb

Browse files
committed
Add Dockerfile
1 parent 0be4386 commit 7ad93cb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM golang:alpine AS build
2+
3+
RUN apk add --update git
4+
WORKDIR /go/src/github.com/codelytv/golang-hex-examples
5+
COPY . .
6+
RUN CGO_ENABLED=0 go build -o /go/bin/codelytv-mooc-api 15-deploy-to-production/cmd/api/main.go
7+
8+
# Building image with the binary
9+
FROM scratch
10+
COPY --from=build /go/bin/codelytv-mooc-api /go/bin/codelytv-mooc-api
11+
ENTRYPOINT ["/go/bin/codelytv-mooc-api"]

0 commit comments

Comments
 (0)