A basic Next.js app with a Dockerfile and compose.yaml ready to deploy to AWS with Defang.
- Install Defang
- Authenticate with Defang
- (optional) Authenticate with AWS
- Run
defang compose up
in the root of this project
This example supports deployment to AWS as a static site. Static files will be copied to an S3 bucket. In the affordable deployment mode (the default), the static files will be served over HTTP from an S3 bucket.
:::info
Note that some top-level domains (TLDs), such as .app
, require HSTS, which will disallow browsers from accessing the site over HTTP. If you want to use such a TLD, you must serve the static files over HTTPS by using either the balanced or high_availability deployment mode.
:::
To serve the static files over HTTPS, use either the balanced or high_availability deployment mode, which will create a CloudFront distribution in front of the S3 bucket.
To deploy this project as a static site, run:
defang compose up -f compose.static.yaml --provider=aws --mode=balanced
Title: Next.js
Short Description: A basic Next.js app.
Tags: Next.js, React, Docker, Node.js, TypeScript, JavaScript, Static
Languages: nodejs