Skip to content

Commit

Permalink
Merge pull request #208 from Cinzya/nextjs-dockerfile
Browse files Browse the repository at this point in the history
Dockerfile deployment instructions for NextJS
  • Loading branch information
ShadowArcanist authored Mar 8, 2025
2 parents ff24ade + b6afe92 commit e266ec7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions docs/applications/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,24 @@ NextJS is a React framework that enables functionality such as server-side rende

[Example repository.](https://github.com/coollabsio/coolify-examples/tree/main/nextjs)

## Server build (NodeJS)
## Deploy with Nixpacks

### Server build (NodeJS)

- Set `Build Pack` to `nixpacks`.

## Static build (SPA)
### Static build (SPA)

- Set `Build Pack` to `nixpacks`.
- Enable `Is it a static site?`.
- Set `Output Directory` to `out`.

## Deploy with Dockerfile

If you are having problems with Nixpacks or want more control over the building stage, you can use a Dockerfile to deploy your NextJS application.

### Prerequisites

1. Set `Ports Exposes` field to `3000`.
2. Create a `Dockerfile` in the root of your project and copy the content from the official [NextJS Repository](https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile).
3. Set the Build Pack to `Dockerfile`.

0 comments on commit e266ec7

Please sign in to comment.