The best way to control Claude Code, Codex and more from any computer or phone

main
mdx 81 lines 1.95 KB
Raw
1 ---
2 title: Vocs
3 description: Deploy a Vocs documentation site to Cloud Run with GCP.Website.Vocs.
4 sidebar:
5 order: 21
6 ---
7
8 import PackageManagers from "../../../../components/PackageManagers.astro";
9
10 export const devDeps = "@alchemy.run/frontend-frameworks";
11
12 `GCP.Website.Vocs` deploys a [Vocs](https://vocs.dev) documentation
13 site to Cloud Run. Static pages are served first, and everything else
14 is rendered by the server.
15
16 ## Install
17
18 The build integration ships separately. It only runs at deploy time,
19 so a dev dependency is enough:
20
21 <PackageManagers dev={devDeps} />
22
23 Docker has to be running when you deploy. The image is built on your
24 machine.
25
26 ## Deploy the site
27
28 ```typescript
29 // alchemy.run.ts
30 import * as Alchemy from "alchemy";
31 import * as GCP from "@alchemy.run/gcp";
32 import * as Effect from "effect/Effect";
33
34 export const Docs = GCP.Website.Vocs("Docs");
35
36 export default Alchemy.Stack(
37 "MySite",
38 { providers: GCP.providers(), state: GCP.state() },
39 Effect.gen(function* () {
40 const site = yield* Docs;
41 return { url: site.url };
42 }),
43 );
44 ```
45
46 Run `alchemy deploy`. `site.url` is the Cloud Run service URL.
47
48 ## Custom output directory
49
50 If `vocs.config.*` changes `outDir`, pass the same value:
51
52 ```typescript
53 export const Docs = GCP.Website.Vocs("Docs", {
54 rootDir: "./docs",
55 outDir: "build",
56 });
57 ```
58
59 ## Tune Cloud Run
60
61 ```typescript
62 export const Docs = GCP.Website.Vocs("Docs", {
63 scaling: { minInstanceCount: 1 },
64 resources: { limits: { cpu: "1", memory: "1Gi" } },
65 });
66 ```
67
68 One warm instance means no cold start for the first visitor. See
69 [Websites](/gcp/frontend/websites#tune-cloud-run) for the other
70 settings.
71
72 ## Local development
73
74 `alchemy dev` runs the framework's dev server with hot reload and
75 creates nothing in the cloud. Wrap the site in `Alchemy.remote()` to
76 deploy it for real during dev.
77
78 ## Where next
79
80 - [Websites](/gcp/frontend/websites) — the settings every site shares.
81 - [Website reference](/providers/gcp/website#vocs) — every prop.