Skip to content

Commit

Permalink
Merge pull request #26 from eyalzek/feat/docker-multi-stage-build
Browse files Browse the repository at this point in the history
Update Dockerfile to use multi-stage build
  • Loading branch information
davidramiro authored Jun 5, 2024
2 parents 397f972 + 84eda73 commit 8f73091
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
FROM golang:1.22
FROM golang:1.22 AS build-stage

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

COPY . ./

RUN CGO_ENABLED=0 GOOS=linux go build -o /frigabun

FROM gcr.io/distroless/static-debian11 AS build-release-stage

COPY --from=build-stage /frigabun /frigabun

WORKDIR /app
EXPOSE 9595

CMD ["/frigabun"]
CMD ["/frigabun"]

0 comments on commit 8f73091

Please sign in to comment.