Skip to content

Commit f93cb6b

Browse files
committed
address review comments
1 parent 02a0881 commit f93cb6b

File tree

4 files changed

+42
-245
lines changed

4 files changed

+42
-245
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### Add render and railway deployment pages ([PR #8242](https://github.com/apollographql/router/pull/8242))
2+
3+
Add two new deployment guides for popular hosting platforms: one for [Render](https://render.com)
4+
and one for [Railway](https://railway.app).
5+
6+
By [@the-gigi-apollo](https://github.com/the-gigi-apollo) in https://github.com/apollographql/router/pull/8242

.changesets/docs_gigi_dxm_227_add_railway_and_render_deployment_guides.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/source/routing/self-hosted/managed-hosting/railway.mdx

Lines changed: 16 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,31 @@ Before you start:
2424

2525
The fastest way to deploy the Apollo Router on Railway is using the official template:
2626

27-
1. **Deploy the template**:
28-
- Visit the [Apollo Router Template repository](https://github.com/apollographql/router-template)
29-
- Click the **Deploy on Railway** button: [![Deploy on Railway](https://railway.app/button.svg)](https://railway.com/deploy/apollo-router)
27+
1. Deploy the template:
28+
- Click [![Deploy on Railway](https://railway.app/button.svg)](https://railway.com/deploy/apollo-router)
3029

31-
2. **Configure your deployment**:
30+
2. Configure your deployment:
3231
- **Template Name**: Enter a name for your deployment (e.g., `my-apollo-router`)
3332
- **Repository Name**: Choose a name for the forked repository
3433

35-
3. **Set environment variables**:
34+
3. Set environment variables:
3635
- `APOLLO_KEY`: Your Graph API key from GraphOS Studio
3736
- `APOLLO_GRAPH_REF`: Your graph reference (e.g., `my-graph@production`)
3837
- Railway automatically sets the `PORT` variable to the correct value
3938

40-
4. **Deploy**: Click **Deploy** to start the deployment.
39+
4. Deploy: Click **Deploy** to start the deployment.
4140

42-
5. **Verify deployment**: Once deployed, visit your service URL to confirm the router is running. Railway provides a public URL for your service.
41+
5. Verify deployment: After the deployment finishes, visit your service URL to confirm the router is running. Railway provides a public URL for your service.
4342

4443
## Option 2: Custom deployment
4544

46-
If you need more control over your deployment, you can set up a custom deployment using the Apollo Runtime container:
45+
If you need more control over your deployment, you can set up a custom deployment using the Apollo Runtime container image:
4746

48-
### Using Apollo Runtime container
47+
### Using Apollo Runtime container image
4948

50-
The Apollo Runtime container provides a production-ready router with sensible defaults, eliminating the need for complex configuration in most cases.
49+
The Apollo Runtime container image provides a production-ready router with sensible defaults, eliminating the need for complex configuration in most cases.
5150

52-
1. Create a new repository or fork the [router-template](https://github.com/apollographql/router-template) with the following files:
51+
1. Fork the [router-template](https://github.com/apollographql/router-template) repository.
5352

5453
2. (Optional) Create a `router.yaml` configuration file for custom settings:
5554

@@ -68,7 +67,7 @@ The Apollo Runtime container provides a production-ready router with sensible de
6867
3. Create a `Dockerfile`:
6968

7069
```dockerfile
71-
# Use the official Apollo Runtime container as the base
70+
# Use the official Apollo Runtime container image as the base
7271
FROM ghcr.io/apollographql/apollo-runtime:0.0.14_router2.5.0_mcp-server0.7.0
7372
7473
# Optionally copy custom router configuration
@@ -77,22 +76,22 @@ The Apollo Runtime container provides a production-ready router with sensible de
7776

7877
### Deploy to Railway
7978

80-
1. **Connect your repository**:
79+
1. Connect your repository:
8180
- In your Railway dashboard, click **New Project**
8281
- Select **Deploy from GitHub repo**
8382
- Connect and authorize your GitHub repository
8483

85-
2. **Railway automatically configures the service**:
84+
2. Railway automatically configures the service:
8685
- Railway detects your Dockerfile and configures the service
8786
- The build and deployment process starts automatically
8887

89-
3. **Set environment variables**:
88+
3. Set environment variables:
9089
- In your project dashboard, go to the **Variables** tab
9190
- Add `APOLLO_KEY` and set it to your Graph API key
9291
- Add `APOLLO_GRAPH_REF` and set it to your graph reference
9392
- Railway automatically provides the `PORT` variable
9493

95-
4. **Automatic deployment**: Railway automatically redeploys your service when environment variables are added
94+
4. Automatic deployment: Railway automatically redeploys your service when environment variables are added
9695

9796
## Apollo MCP Server
9897

@@ -102,115 +101,11 @@ The Apollo Runtime container includes an optional MCP (Model Context Protocol) s
102101

103102
The MCP server is disabled by default. To enable it, set the `MCP_ENABLE` environment variable to `1`:
104103

105-
**In Railway dashboard:**
104+
In Railway dashboard:
106105
1. Go to your service's **Variables** tab
107106
2. Add `MCP_ENABLE` with value `1`
108107
3. Railway will automatically redeploy your service
109108

110-
### MCP Server Features
111-
112-
When enabled, the MCP server provides:
113-
- Schema introspection capabilities for AI assistants
114-
- Structured access to GraphQL operations
115-
- Enhanced development experience with AI tools
116-
117-
## Configuration options
118-
119-
### Environment variables
120-
121-
The router accepts multiple environment variables for configuration:
122-
123-
- `APOLLO_KEY`: Your Graph API key (required)
124-
- `APOLLO_GRAPH_REF`: Your graph reference (required)
125-
- `PORT`: Port for the router to listen on (automatically set by Railway)
126-
- `MCP_ENABLE`: Enable MCP server for AI assistant integration (default: disabled)
127-
- `APOLLO_ROUTER_LOG`: Log level (e.g., `info`, `debug`)
128-
129-
### Health checks
130-
131-
Railway automatically configures health checks. The router exposes a health check endpoint at `/health` on port 8088 by default.
132-
133-
### Custom domains
134-
135-
To use a custom domain with your Railway deployment:
136-
137-
1. In your Railway project, go to the **Settings** tab
138-
2. Navigate to the **Domains** section
139-
3. Click **Generate Domain** for a Railway subdomain, or **Custom Domain** for your own domain
140-
4. For custom domains, configure your DNS to point to Railway's provided target
141-
142-
## Security considerations
143-
144-
**Important security settings to review before production deployment:**
145-
146-
### CORS Configuration
147-
The template includes development-friendly CORS settings that may not be suitable for production:
148-
149-
```yaml title="router.yaml"
150-
cors:
151-
# Development setting - replace for production
152-
allow_any_origin: true
153-
154-
# Production setting - specify your domains
155-
# origins:
156-
# - "https://yourdomain.com"
157-
# - "https://app.yourdomain.com"
158-
```
159-
160-
### Other security considerations
161-
- **Introspection**: The runtime container disables introspection by default in production
162-
- **Subgraph errors**: All errors are exposed by default (`include_subgraph_errors.all: true`) - consider limiting in production
163-
- **Rate limiting**: Configure appropriate request limits for your use case
164-
- **MCP Server**: Only enable the MCP server (`MCP_ENABLE=1`) in development or trusted environments
165-
166-
## Monitoring and observability
167-
168-
### Railway metrics
169-
Railway provides built-in metrics for your service including:
170-
- CPU and memory usage
171-
- Network usage
172-
- Build and deployment logs
173-
- Request metrics (available in higher tiers)
174-
175-
### Router telemetry
176-
The router can export telemetry data to various observability platforms. Configure this in your `router.yaml`:
177-
178-
```yaml title="router.yaml"
179-
telemetry:
180-
exporters:
181-
metrics:
182-
prometheus:
183-
enabled: true
184-
```
185-
186-
## Scaling
187-
188-
Railway automatically handles scaling based on your usage:
189-
- **Hobby Plan**: Single instance with resource limits
190-
- **Pro Plan**: Auto-scaling capabilities with higher resource limits
191-
- **Team Plans**: Advanced scaling options and priority support
192-
193-
## Troubleshooting
194-
195-
### Common issues
196-
197-
1. **Service won't start**:
198-
- Check that `APOLLO_KEY` and `APOLLO_GRAPH_REF` are correctly set in the **Variables** tab
199-
- Verify your graph exists in GraphOS Studio
200-
- Check deployment logs in the Railway dashboard
201-
202-
2. **Connection refused errors**:
203-
- Ensure the router is listening on `0.0.0.0:$PORT` (Railway provides the PORT variable)
204-
- Verify your Dockerfile exposes the correct port
205-
206-
3. **GraphOS connection issues**:
207-
- Verify your `APOLLO_KEY` has the correct permissions
208-
- Check that your `APOLLO_GRAPH_REF` format is correct (e.g., `graph-name@variant`)
209-
210-
4. **Build failures**:
211-
- Check that your Dockerfile is valid and the base image is accessible
212-
- Review build logs in the Railway dashboard for specific error messages
213-
214109
### Get help
215110

216111
- Check the [Railway documentation](https://docs.railway.app/) for platform-specific issues

0 commit comments

Comments
 (0)