Skip to content

Commit e90455e

Browse files
tylerhogarthclaudeankur-arch
authored
docs: restructure Compute custom domains page and explain switchboard (#8042)
* docs: restructure Compute custom domains page and explain switchboard Splits the setup into numbered steps under a new "Add a custom domain" heading, adds a "What is switchboard?" note and a CNAME example table, and cross-links prerequisites and error codes to their canonical pages. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs: clarify domain add-step wording Address review feedback: the add command registers the domain first and prints the CNAME to create if DNS isn't visible yet, rather than implying the domain is only created when the CNAME already exists. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Ankur Datta <64993082+ankur-arch@users.noreply.github.com>
1 parent 9459105 commit e90455e

1 file changed

Lines changed: 44 additions & 20 deletions

File tree

apps/docs/content/docs/compute/domains.mdx

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,46 @@ metaTitle: Custom domains | Prisma Compute
66
metaDescription: Add a custom domain to a Prisma Compute app, configure the CNAME record, watch provisioning, and troubleshoot failures.
77
---
88

9-
Point a custom domain at a production app and the platform verifies DNS and provisions TLS for you. In beta, custom domains are production-only.
9+
Configure custom domains that point to your [production app](/compute/branching). You can't configure custom domains for preview apps.
1010

1111
## Before you start
1212

1313
You'll need:
1414

15-
- A linked project.
16-
- A production app with a promoted, live deployment.
17-
- Access to your domain's DNS settings.
15+
- A [linked project](/compute/getting-started).
16+
- A production app with a [promoted, running deployment](/compute/deployments).
17+
- Access to edit DNS records within your DNS provider.
1818

19-
Domain commands target the production branch. Pointing them at any other branch fails with `BRANCH_NOT_DEPLOYABLE`.
19+
Domain commands target the [production branch](/compute/branching). Pointing them at any other branch fails with [`BRANCH_NOT_DEPLOYABLE`](/compute/cli-reference#error-codes).
2020

21-
## Add a domain
21+
## Add a custom domain
22+
23+
### 1. Add a domain
2224

2325
```npm
2426
npx @prisma/cli@latest app domain add shop.acme.com --app web
2527
```
2628

27-
The command prints a **CNAME** record. Add it at your DNS provider; it points your hostname at Prisma's routing. Then wait for the domain to go live:
29+
The command registers the custom domain for your production app. If the **CNAME** record isn't visible yet, it prints the record name and value for you to create.
30+
31+
### 2. Create CNAME Record
32+
33+
Add the printed DNS record which looks like `switchboard.{region}.prisma.build`.
34+
35+
Example:
36+
| Type | Name | Value | TTL |
37+
| ----- | ------ | ------------------------------ | --- |
38+
| CNAME | `shop` | `switchboard.fra.prisma.build` | 300 |
39+
40+
:::note[What is switchboard?]
41+
42+
Switchboard is the routing layer that sits in front of your Compute app. Switchboard verifies the domain, provisions and terminates TLS, then forwards traffic to your app: one domain, one CNAME, one Compute app.
43+
44+
:::
45+
46+
### 3. Wait for DNS propagation
47+
48+
Verify using:
2849

2950
```npm
3051
npx @prisma/cli@latest app domain wait shop.acme.com --app web
@@ -38,14 +59,15 @@ npx @prisma/cli@latest app domain wait shop.acme.com --app web --timeout 0 --jso
3859

3960
In `--json` mode, `wait` streams newline-delimited status events, so an agent can track provisioning as it progresses.
4061

41-
## Check and fix
62+
## Remove a domain
4263

4364
```npm
44-
npx @prisma/cli@latest app domain show shop.acme.com --app web
45-
npx @prisma/cli@latest app domain retry shop.acme.com --app web
65+
npx @prisma/cli@latest app domain remove shop.acme.com --app web
4666
```
4767

48-
`show` gives you the exact state, certificate details, and any DNS hints. `retry` restarts stuck provisioning; if a domain isn't in a retryable state, it returns `DOMAIN_RETRY_NOT_ELIGIBLE`.
68+
Removing detaches the domain from the app; pass `--yes` to skip the confirmation prompt. Prisma can't touch your DNS, so the CNAME record stays behind: delete it at your provider once you no longer need it.
69+
70+
## States
4971

5072
A domain moves through these states:
5173

@@ -57,22 +79,24 @@ A domain moves through these states:
5779
| `active` | The domain is fully provisioned and routing traffic to your app |
5880
| `failed` | Registration or provisioning failed; see the failure reason |
5981

60-
## Remove a domain
61-
62-
```npm
63-
npx @prisma/cli@latest app domain remove shop.acme.com --app web
64-
```
65-
66-
Removing detaches the domain from the app; pass `--yes` to skip the confirmation prompt. Prisma can't touch your DNS, so the CNAME record stays behind: delete it at your provider once you no longer need it.
67-
6882
## Limits
6983

70-
- Custom domains are production-only.
84+
- Custom domains are only available on production apps.
7185
- DNS uses CNAME records.
7286
- Up to 3 custom domains per app; more returns `DOMAIN_QUOTA_EXCEEDED`.
7387
- There's no workspace-wide domain list in the CLI.
7488

89+
## Troubleshooting
90+
91+
```npm
92+
npx @prisma/cli@latest app domain show shop.acme.com --app web
93+
npx @prisma/cli@latest app domain retry shop.acme.com --app web
94+
```
95+
96+
`show` gives you the exact state, certificate details, and any DNS hints. `retry` restarts stuck provisioning; if a domain isn't in a retryable state, it returns `DOMAIN_RETRY_NOT_ELIGIBLE`.
97+
7598
## Next steps
7699

77100
- [Deployments](/compute/deployments): promote a deployment to production first.
78101
- [Known limitations](/compute/limitations): what the beta can and can't do.
102+
- [`app domain` reference](/compute/cli-reference#app-domain): every domain subcommand and flag.

0 commit comments

Comments
 (0)