-
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
Showing
1 changed file
with
4 additions
and
5 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,19 +1,18 @@ | ||
# Build the application from source. | ||
FROM golang:1.21.1-alpine@sha256:96634e55b363cb93d39f78fb18aa64abc7f96d372c176660d7b8b6118939d97b AS go-builder | ||
|
||
WORKDIR /tmp/app | ||
WORKDIR /app | ||
COPY go.mod go.sum cmd ./ | ||
RUN go build -o /tmp/deadnews-template-go ./... | ||
RUN go build -o /app/dist/deadnews-template-go ./... | ||
|
||
# Deploy the application binary into a lean image. | ||
FROM gcr.io/distroless/static-debian12:latest@sha256:98e138282ba524ff4f5124fec603f82ee2331df4ba981d169b3ded8bcd83ca52 AS runtime | ||
LABEL maintainer "DeadNews <aurczpbgr@mozmail.com>" | ||
|
||
WORKDIR / | ||
COPY --from=go-builder /tmp/deadnews-template-go /bin/deadnews-template-go | ||
COPY --from=go-builder /app/dist/deadnews-template-go /usr/local/bin/deadnews-template-go | ||
|
||
USER nonroot:nonroot | ||
EXPOSE 1271 | ||
HEALTHCHECK --interval=60s --timeout=3s CMD curl --fail http://127.0.0.1:1271/health || exit 1 | ||
|
||
CMD ["/bin/deadnews-template-go"] | ||
CMD ["deadnews-template-go"] |