diff --git a/packages/cdk-next-app/README.md b/packages/cdk-next-app/README.md index bc9068cf..d7d1ffa5 100644 --- a/packages/cdk-next-app/README.md +++ b/packages/cdk-next-app/README.md @@ -4,9 +4,37 @@ The NextApp CDK construct deploys a standalone Next.js build to a load balanced ## Example +### Standard Repository + +For a non-mnonorepo build, simply provide the path to the directory that contains your Dockerfile. + +```ts +new NextApp(this, "NextApp", { + path: "../next", +}); +``` + +### Monorepo + +For monorepo builds, set the build context to the root of your monorepo, and provide the path to your Next.js module's Dockerfile. + +```ts +new NextApp(this, "NextApp", { + path: "../../", + file: "apps/next/Dockerfile", +}); +``` + +### Scaling + +The NextApp is based on the [DockerCluster](https://github.com/codedazur/toolkit/tree/main/packages/cdk-docker-cluster) construct and supports all of its features for horizontal and vertical scaling. + ```ts -new NextApp(this, "Next", { - path: "../next", // Must contain a Dockerfile. +new NextApp(this, "NextApp", { + ... + cpu: 1024, + memory: 4096, + tasks: { min: 1, max: 10 }, }); ```