You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fastest way to deploy the Apollo Router on Railway is using the official template:
26
26
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: [](https://railway.com/deploy/apollo-router)
27
+
1. Deploy the template:
28
+
- Click [](https://railway.com/deploy/apollo-router)
30
29
31
-
2.**Configure your deployment**:
30
+
2. Configure your deployment:
32
31
-**Template Name**: Enter a name for your deployment (e.g., `my-apollo-router`)
33
32
-**Repository Name**: Choose a name for the forked repository
34
33
35
-
3.**Set environment variables**:
34
+
3. Set environment variables:
36
35
-`APOLLO_KEY`: Your Graph API key from GraphOS Studio
37
36
-`APOLLO_GRAPH_REF`: Your graph reference (e.g., `my-graph@production`)
38
37
- Railway automatically sets the `PORT` variable to the correct value
39
38
40
-
4.**Deploy**: Click **Deploy** to start the deployment.
39
+
4. Deploy: Click **Deploy** to start the deployment.
41
40
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.
43
42
44
43
## Option 2: Custom deployment
45
44
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:
47
46
48
-
### Using Apollo Runtime container
47
+
### Using Apollo Runtime container image
49
48
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.
51
50
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.
53
52
54
53
2. (Optional) Create a `router.yaml` configuration file for custom settings:
55
54
@@ -68,7 +67,7 @@ The Apollo Runtime container provides a production-ready router with sensible de
68
67
3. Create a `Dockerfile`:
69
68
70
69
```dockerfile
71
-
# Use the official Apollo Runtime container as the base
70
+
# Use the official Apollo Runtime container image as the base
72
71
FROM ghcr.io/apollographql/apollo-runtime:0.0.14_router2.5.0_mcp-server0.7.0
73
72
74
73
# Optionally copy custom router configuration
@@ -77,22 +76,22 @@ The Apollo Runtime container provides a production-ready router with sensible de
77
76
78
77
### Deploy to Railway
79
78
80
-
1. **Connect your repository**:
79
+
1. Connect your repository:
81
80
- In your Railway dashboard, click **New Project**
82
81
- Select **Deploy from GitHub repo**
83
82
- Connect and authorize your GitHub repository
84
83
85
-
2. **Railway automatically configures the service**:
84
+
2. Railway automatically configures the service:
86
85
- Railway detects your Dockerfile and configures the service
87
86
- The build and deployment process starts automatically
88
87
89
-
3. **Set environment variables**:
88
+
3. Set environment variables:
90
89
- In your project dashboard, go to the **Variables** tab
91
90
- Add `APOLLO_KEY` and set it to your Graph API key
92
91
- Add `APOLLO_GRAPH_REF` and set it to your graph reference
93
92
- Railway automatically provides the `PORT` variable
94
93
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
96
95
97
96
## Apollo MCP Server
98
97
@@ -102,115 +101,11 @@ The Apollo Runtime container includes an optional MCP (Model Context Protocol) s
102
101
103
102
The MCP server is disabled by default. To enable it, set the `MCP_ENABLE` environment variable to `1`:
104
103
105
-
**In Railway dashboard:**
104
+
In Railway dashboard:
106
105
1. Go to your service's **Variables** tab
107
106
2. Add `MCP_ENABLE` with value `1`
108
107
3. Railway will automatically redeploy your service
109
108
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)
0 commit comments