Docs
Try Apollo Studio

Containerizing the Apollo Router


More details about Apollo Router images are available on GitHub.

Each release of the Apollo Router includes both default and debug images. Each image for a release contains the same build. Debug images additionally contain a "busybox" to help with container debugging.

Note: The Apollo Router is made available under the Elastic License v2.0 (ELv2). This applies to its source code and all distributions. For details, see our licensing page.

Here's a basic example of running a router image with Docker (make sure to replace <image version> with whichever version you want to use, such as v0.1.0-preview.1):

Docker
docker run -p 4000:4000 \
--env APOLLO_GRAPH_REF="<your graph>" \
--env APOLLO_KEY="<your key>" \
--rm \
ghcr.io/apollographql/router:<image version>

This command downloads your supergraph schema from Apollo and uses a default configuration that listens for connections on port 4000.

For more complex configuration (such as overriding subgraph URLs or propagating headers), see Configuring the Apollo Router.

For examples of using router images in specific environments, see the guides for Docker and Kubernetes.

Image file layout

  • The router executable is located in the /dist directory.
  • A default configuration file, router.yaml, is located in the dist/config directory.
  • There is also a /dist/schema directory for convenient mounting of a locally defined supergraph schema.
  • Licensing details are also available in the /dist directory.

Image build

Apollo Router images are based on distroless, which is designed to provide constrained, secure, and small images.

Edit on GitHub
Previous
Tracing
Next
Docker