Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

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