Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mgazza committed Dec 11, 2020
1 parent 532cbe4 commit 2c4c394
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vendor
README.md
.idea
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM golang:1.14-alpine3.12 as build-stage
WORKDIR /build

COPY go.mod go.sum ./
RUN go mod download


COPY hack/main.go .
RUN CGO_ENABLED=0 go build

COPY . .
RUN CGO_ENABLED=0 go build -o app .

FROM alpine as production-stage
COPY --from=build-stage /build/app ./app
CMD ["./app"]

0 comments on commit 2c4c394

Please sign in to comment.