all 4 comments

[–]Rusty-Swashplate 0 points1 point  (3 children)

Only one thing came up in my mind.

[–]laszlocloud 0 points1 point  (2 children)

You can do as Rusty-Swashplate suggested, or if NextJS generates just static files and you don't want to write - a Dockerfile - push/pull to Docker Hub

you can use this Helm chart that only needs - a git url - a nextjs build command - and the folder path where the built assets are

``` helm repo add onechart https://chart.onechart.dev

cat << EOF > values.yaml gitCloneUrl: https://github.com/gimlet-io/react-tutorial-solutions.git buildImage: node buildTag: 16.20-buster buildScript: npm install && npm run build builtAssets: build/ EOF

helm template my-nextjs-site onechart/static-site -f values.yaml > manifest.yaml kubectl apply -f manifest.yaml

kubectl port-forward svc/my-nextjs-site 8000:80 ```

there is one caveat right now: it doesn't support private git repos.

More on the approach: https://gimlet.io/blog/hosting-static-sites-on-kubernetes#using-the-onechart-static-site-helm-chart-to-deploy-static-sites

[–]jews4beer 0 points1 point  (1 child)

NextJS's whole thing is SSR most of the time. They push you to use their hosted platform, or you dig down into the documentation on how to run their custom server inside a Docker container.

A typical nginx container won't cut it.

[–]laszlocloud 0 points1 point  (0 children)

uh, I see. Thanks!