Skip to content

Commit 9d3d7cd

Browse files
authored
Merge pull request #1051 from timlrx/docs/docker
Add faq to deploy with docker
2 parents 6289f94 + 9a3c82f commit 9d3d7cd

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ Consider removing the following features that cannot be used in a static build:
322322
323323
- [How can I add a custom MDX component?](/faq/custom-mdx-component.md)
324324
- [How can I customize the `kbar` search?](/faq/customize-kbar-search.md)
325+
- [Deploy with docker](/faq/deploy-with-docker.md)
325326
326327
## Support
327328

faq/deploy-with-docker.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Deploy with Docker
2+
3+
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:
4+
5+
```js
6+
// next.config.js
7+
module.exports = {
8+
// ... rest of the configuration.
9+
output: 'standalone',
10+
}
11+
```
12+
13+
You can now build the docker image and run it:
14+
15+
```bash
16+
docker build -t nextjs-docker .
17+
docker run -p 3000:3000 nextjs-docker
18+
```
19+
20+
Alternatively, to use docker compose, refer to the [docker compose repo](https://github.com/vercel/next.js/tree/canary/examples/with-docker-compose).

0 commit comments

Comments
 (0)