Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

26 lignes
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"]