Hello Everybody I am working on a Next Js App over Sitecore it is working fine locally the app is created and working on Localhost but now I need deploy the App to production I have a Sitecore 10.3 Instance runinng Cm on a server and Cd on another server I can't find any method to deploy Next Js App on a scaled Sitecore instance Except Vercel and it is not allowed to use it in my company. Has anybody Faced this issue to help me ?
1 Answer
Vercel is a private platform created by the makers of Next.js.
So the creating app locally is free but when it goes to production it has to be hosted on the paid Vercel platform.
But there is a way of self-hosting Next.js with 3 different options.
Node.js server
Docker container
A static export
One of the known option is below.
Docker Image
Next.js can be deployed to any hosting provider that supports Docker containers. You can use this approach when deploying to container orchestrators such as Kubernetes or when running inside a container in any cloud provider.
- Install Docker on your machine.
- Clone our example (or the multi-environment example).
- Build your container:
docker build -t nextjs-docker
. - Run your container:
docker run -p 3000:3000 nextjs-docker
.
Next.js through Docker supports all Next.js features. More details can be found below. I hope this will help.
https://nextjs.org/docs/pages/building-your-application/deploying#self-hosting