-
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.
build(deployments): update dockerfile to use scratch image
- Loading branch information
Showing
2 changed files
with
4 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,4 @@ | ||
FROM golang:1.23-alpine AS builder | ||
|
||
WORKDIR /app | ||
|
||
# copy and download all necessary modules | ||
COPY go.mod . | ||
COPY go.sum . | ||
|
||
RUN go mod download | ||
|
||
# copy all local files to Image | ||
COPY . . | ||
|
||
# build Docker Image with CGO Enabled | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o go-qris ./cmd | ||
|
||
FROM alpine:latest | ||
|
||
WORKDIR /app | ||
|
||
# get Executable Binary file to new Image | ||
COPY --from=builder /app/go-qris ./ | ||
|
||
# run the server executable | ||
CMD ["./go-qris"] | ||
FROM scratch | ||
COPY go-qris /go-qris | ||
EXPOSE 1337 | ||
ENTRYPOINT ["/go-qris","run"] |
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