You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
498 B

  1. FROM golang:1.21 AS build-stage
  2. WORKDIR /app
  3. COPY go.mod go.sum ./
  4. RUN go mod download
  5. COPY *.go cmd ./
  6. RUN CGO_ENABLED=0 GOOS=linux go build -o /dispatcher ./...
  7. # Run the tests in the container
  8. FROM build-stage AS run-test-stage
  9. RUN go test -v ./...
  10. # Deploy the application binary into a lean image
  11. FROM gcr.io/distroless/base-debian12 AS build-release-stage
  12. WORKDIR /
  13. COPY --from=build-stage /dispatcher /dispatcher
  14. USER nonroot:nonroot
  15. ENV GIN_MODE=release
  16. ENTRYPOINT ["/dispatcher"]