Skip to content

Commit

Permalink
golang multistage
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgamero committed Apr 30, 2024
1 parent 7c9284c commit da172ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions template/dockerfiles/gomodule/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:{{VERSION}}
FROM golang:{{VERSION}} AS builder
ENV PORT {{PORT}}
EXPOSE {{PORT}}

Expand All @@ -9,4 +9,6 @@ RUN go get
RUN go build -v -o app
RUN mv ./app /go/bin/

CMD ["app"]
FROM alpine:latest
COPY --from=builder /go/bin/app /usr/local/bin/app
CMD ["app"]

0 comments on commit da172ea

Please sign in to comment.