New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@codedazur/cdk-next-app

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codedazur/cdk-next-app

The NextApp CDK construct deploys a standalone Next.js build to a load balanced Fargate service on AWS.

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
68
decreased by-30.61%
Maintainers
0
Weekly downloads
 
Created
Source

NextApp

The NextApp CDK construct deploys a standalone Next.js build to a load balanced Fargate service on AWS.

It automatically mounts the ~/.npmrc file as a build secret for installation of private NPM packages.

Prerequisites

Next.js Configuration

Your next.config.js file needs to be configured for standalone output.

// next.config.js
// ...
const nextConfig = {
  // ...
  output: "standalone",
};
// ...

Docker

In order to use this construct, your Next.js application needs to be configured for Docker deployments. See the official documentation for more information.

Example

Standard Repository

For a non-monorepo build, simply provide the path to the directory that contains your Dockerfile.

new NextApp(this, "NextApp", {
  source: "../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.

new NextApp(this, "NextApp", {
  source: {
    directory: "../../",
    file: "apps/next/Dockerfile",
  },
});

Arguments and Secrets

The NextApp is based on the DockerCluster construct and supports all of its features related to Docker's build arguments and secrets.

These arguments and secrets need to be handled appropriately by your Dockerfile in order for them to have any effect.

import { DockerBuildSecret } from "aws-cdk-lib";

new NextApp(this, "NextApp", {
  source: {
    // ...
    arguments: {
      MY_BUILD_ARGUMENT: process.env.MY_BUILD_ARGUMENT,
    },
    secrets: {
      myBuildSecret: new DockerBuildSecret.fromEnvironment("MY_BUILD_SECRET"),
    },
  },
});

Scaling

The NextApp is based on the DockerCluster construct and supports all of its features for vertical scaling and horizontal (auto-)scaling.

new NextApp(this, "NextApp", {
  // ...
  service: {
    cpu: 1024,
    memory: 4096,
    tasks: 3,
  },
});
new NextApp(this, "NextApp", {
  // ...
  service: {
    // ...
    tasks: {
      minimum: 1,
      maximum: 5,
    },
  },
});

FAQs

Package last updated on 19 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc