-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87aa380
commit 9cad666
Showing
3 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM golang:1.21 AS builder | ||
|
||
COPY . /build | ||
WORKDIR /build | ||
RUN go mod download | ||
|
||
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \ | ||
go build \ | ||
-trimpath \ | ||
-ldflags="-w -s" \ | ||
-o app \ | ||
main.go | ||
|
||
FROM scratch | ||
|
||
COPY --from=builder /build/app /root/app | ||
|
||
ENTRYPOINT ["/root/app"] | ||
EXPOSE 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters