diff --git a/api/Dockerfile b/api/Dockerfile index c5a7a448..72d12390 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /app COPY . . # Build the Go app -RUN CGO_ENABLED=0 GOOS=linux go build -o "./api" main.go +RUN make build ############################ # STEP 2 build a small image diff --git a/api/Makefile b/api/Makefile index e5cba891..0cda7400 100644 --- a/api/Makefile +++ b/api/Makefile @@ -26,7 +26,7 @@ help: @sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /' build: - go build -v $(LDFLAGS) -o api main.go + CGO_ENABLED=0 GOOS=linux go build -v $(LDFLAGS) -o api main.go doc: swag init -pd @@ -36,4 +36,4 @@ test: go test -v -cover ./... -.PHONY: build doc test +.PHONY: build doc test \ No newline at end of file diff --git a/api/routes/wormscan/infrastructure/controller.go b/api/routes/wormscan/infrastructure/controller.go index a97e0210..4b50b708 100644 --- a/api/routes/wormscan/infrastructure/controller.go +++ b/api/routes/wormscan/infrastructure/controller.go @@ -54,7 +54,7 @@ func (c *Controller) ReadyCheck(ctx *fiber.Ctx) error { // VersionResponse is the JSON model for the 200 OK response in `GET /api/v1/version`. type VersionResponse struct { - BuildDate string `json:"buildDate"` + BuildDate string `json:"build_date"` Build string `json:"build"` Branch string `json:"branch"` Machine string `json:"machine"`