Skip to content

Commit

Permalink
Merge pull request #1051 from timlrx/docs/docker
Browse files Browse the repository at this point in the history
Add faq to deploy with docker
  • Loading branch information
timlrx authored Nov 3, 2024
2 parents 6289f94 + 9a3c82f commit 9d3d7cd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ Consider removing the following features that cannot be used in a static build:
- [How can I add a custom MDX component?](/faq/custom-mdx-component.md)
- [How can I customize the `kbar` search?](/faq/customize-kbar-search.md)
- [Deploy with docker](/faq/deploy-with-docker.md)
## Support
Expand Down
20 changes: 20 additions & 0 deletions faq/deploy-with-docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Deploy with Docker

Follow the [official Next.js repo docker build example and instructions](https://github.com/vercel/next.js/tree/canary/examples/with-docker) to deploy with docker. Copy the [`Dockerfile`](https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile) into the root of the project and modify the `next.config.js` file:

```js
// next.config.js
module.exports = {
// ... rest of the configuration.
output: 'standalone',
}
```

You can now build the docker image and run it:

```bash
docker build -t nextjs-docker .
docker run -p 3000:3000 nextjs-docker
```

Alternatively, to use docker compose, refer to the [docker compose repo](https://github.com/vercel/next.js/tree/canary/examples/with-docker-compose).

0 comments on commit 9d3d7cd

Please sign in to comment.