Deploy Next.js
Choose a static export or a Compute service for a Next.js project.
If every route can render at build time, deploy the exported files as a Serverless App. If a route needs a running Next.js server for request-time rendering, use Compute.
Export a static site
In your existing Next.js configuration, set output: "export" and trailingSlash: true. Run your project's build script and verify that out/index.html exists. A nested route such as /about/ should produce out/about/index.html.
Run ccp init . and commit the generated cluster-handler.ts and cluster.toml. The handler resolves exported HTML pages by route and returns HTTP 404 for missing pages.
Run ccp dev and open both the home page and a nested route. Check a missing route returns 404. CCP serves the exported JavaScript, CSS and images from the assets directory. Rebuild the Next.js project before each ccp deploy. If this checkout belongs to an existing App, run ccp link first.
Run a Next.js server
Build and publish a Linux x86-64 container image that starts your Next.js server on 0.0.0.0:3000. Configure the service and deploy the published image.
ccp init . --image "$IMAGE_REF" --port 3000
ccp compute deployCommit the resulting Compute settings. On a fresh checkout, follow the Compute linking instructions before redeploying.