Dockerfile 568 B

12345678910111213141516171819202122232425262728
  1. FROM golang:1.22-bookworm as build-env
  2. WORKDIR /go/src/webpush-apn-relay
  3. COPY go.mod ./
  4. COPY go.sum ./
  5. RUN go mod download
  6. COPY *.go ./
  7. RUN CGO_ENABLED=0 go build -ldflags "-s -w" -o webpush-apn-relay
  8. FROM gcr.io/distroless/base
  9. COPY --from=build-env /go/src/webpush-apn-relay/webpush-apn-relay /
  10. ADD cas.crt /cas.crt
  11. ENV CA_FILENAME /cas.crt
  12. ARG GIT_REPOSITORY_URL
  13. ARG GIT_COMMIT_SHA
  14. ARG VERSION
  15. ENV DD_GIT_REPOSITORY_URL=${GIT_REPOSITORY_URL}
  16. ENV DD_GIT_COMMIT_SHA=${GIT_COMMIT_SHA}
  17. ENV DD_VERSION=${VERSION}
  18. EXPOSE 42069
  19. ENTRYPOINT [ "/webpush-apn-relay" ]