github.com/openfga/openfga@v1.5.4-rc1/Dockerfile (about)

     1  FROM ghcr.io/grpc-ecosystem/grpc-health-probe:v0.4.26@sha256:a04a96bd92126604f5bc10998004d5274fa9e6a232dba0a3ef3eb18a318990ff as grpc_health_probe
     2  FROM cgr.dev/chainguard/go:1.21@sha256:40fb38b3f61d1ecdecd2bfe3d14fa621ab5e9ecb4c9ebba590276c2992f3e282 AS builder
     3  
     4  WORKDIR /app
     5  
     6  # install and cache dependencies
     7  RUN --mount=type=cache,target=/root/go/pkg/mod \
     8      --mount=type=bind,source=go.sum,target=go.sum \
     9      --mount=type=bind,source=go.mod,target=go.mod \
    10      go mod download -x
    11  
    12  # build with cache
    13  RUN --mount=type=cache,target=/root/.cache/go-build \
    14      --mount=type=cache,target=/root/go/pkg/mod \
    15      --mount=type=bind,target=. \
    16      CGO_ENABLED=0 go build -o /bin/openfga ./cmd/openfga
    17  
    18  FROM cgr.dev/chainguard/static@sha256:dea7cbb98630ecf732c9d840edec0bda5da5c0c7967a25354fb9f3d8c7f87c1a
    19  
    20  EXPOSE 8081
    21  EXPOSE 8080
    22  EXPOSE 3000
    23  
    24  COPY --from=grpc_health_probe /ko-app/grpc-health-probe /usr/local/bin/grpc_health_probe
    25  COPY --from=builder /bin/openfga /openfga
    26  
    27  # Healthcheck configuration for the container using grpc_health_probe
    28  # The container will be considered healthy if the gRPC health probe returns a successful response.
    29  HEALTHCHECK --interval=5s --timeout=30s --retries=3 CMD ["/usr/local/bin/grpc_health_probe", "-addr=:8081"]
    30  
    31  ENTRYPOINT ["/openfga"]