diff --git a/README.md b/README.md index 165509e..7899077 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/faq/deploy-with-docker.md b/faq/deploy-with-docker.md new file mode 100644 index 0000000..273b82c --- /dev/null +++ b/faq/deploy-with-docker.md @@ -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).