NEXT JS APP Hosting on AWS
This will be basically a stupid question, I guess, but I could not find an answer, so I hope you guys can help me out.
I have a nextjs project that is basically a gallery portfolio page, and I am using the nextjs server components as well as the client ones.
Is my application still a static website if I am using server components? The reason I ask this is because I would like to host the site in a S3 bucket, but as far as I know, this is only for static websites.
My server components are actually the whole gallery.
6 Replies
If your react server components all use static rendering then it is possible https://nextjs.org/docs/pages/building-your-application/deploying/static-exports
Deploying: Static Exports
Next.js enables starting as a static site or Single-Page Application (SPA), then later optionally upgrading to use features that require a server.
Is this recommended, or is there another way?
In the sense of my approach to deploying it
There are multiple way to deploy to something like AWS depending on what the architecture you want is :
- nextjs standalone mode in a docker container
- opennext : https://open-next.js.org/
- https://sst.dev/
For Nextjs in standalone mode: https://github.com/vercel/next.js/tree/canary/examples/with-docker
OpenNext and sst can deploy your app like what vercel is doing : https://github.com/sst/open-next#features
Dont
Ssr and caching dont work properly
So what would be the recommend way in your opinion
Vercel for now
Amazon dosent care that aws is broken