-
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
6 changed files
with
87 additions
and
16 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.data | ||
.github | ||
bin | ||
deploy | ||
.envrc | ||
tests | ||
vendor |
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,2 +1,3 @@ | ||
.envrc | ||
Makefile.properties | ||
vendor |
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,31 @@ | ||
ARG GO_VERSION=1.20 | ||
FROM golang:${GO_VERSION}-alpine AS build | ||
RUN apk add --no-cache make g++ ca-certificates | ||
WORKDIR /go/src/app | ||
ARG APP_NAME=app | ||
RUN apk update --no-cache | ||
RUN apk add --no-cache \ | ||
ca-certificates \ | ||
g++ \ | ||
git \ | ||
make | ||
RUN go install github.com/swaggo/swag/cmd/swag@master | ||
WORKDIR /go/src/${APP_NAME} | ||
COPY ./go.mod ./go.sum ./ | ||
RUN go mod download -x | ||
COPY . . | ||
COPY ./.git ./.git | ||
COPY ./cmd ./cmd | ||
COPY ./internal ./internal | ||
COPY ./Makefile . | ||
ENV CGO_ENABLED=0 | ||
RUN go install github.com/swaggo/swag/cmd/swag@master | ||
RUN make docs-swaggo | ||
RUN make deps | ||
RUN make binary | ||
RUN sha256sum ./bin/app > ./bin/app.sha256 | ||
RUN sha256sum ./bin/${APP_NAME} > ./bin/${APP_NAME}.sha256 | ||
|
||
FROM scratch AS final | ||
COPY --from=build /go/src/app/bin/app /app | ||
COPY --from=build /go/src/app/bin/app.sha256 /app.sha256 | ||
ARG APP_NAME=app | ||
ENV APP_NAME=${APP_NAME} | ||
COPY --from=build /go/src/${APP_NAME}/bin/${APP_NAME} /entrypoint | ||
COPY --from=build /go/src/${APP_NAME}/bin/${APP_NAME}.sha256 /${APP_NAME}.sha256 | ||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
ENTRYPOINT ["/app"] | ||
# CMD [ /bin/bash ] | ||
ENTRYPOINT [ "/entrypoint" ] |
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
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,6 +1,9 @@ | ||
package constants | ||
|
||
import "time" | ||
|
||
var ( | ||
AppName = "app" | ||
Version = "0.1.0" | ||
AppName = "app" | ||
Version = "0.1.0" | ||
BuildTimestamp = time.Now().UTC().Format("2006-01-02T15:04:05") | ||
) |