Noob question, my apologies.
I'm wondering if anyone knows the recommended deployment flow for NextJS self-hosted (e.g. docker or kubernetes). I'm doing a typical build once, ship per environment while changing environment variables to match the environment but keeping the image the same.
Since NextJS auto-opts-out of SSG when you use "getInitialProps" and "publicRuntimeConfig", I'm wondering, what's the best way to deploy the same image to multiple environments (again, self hosted on generic cloud e.g. docker run).
- Do I have to always bake in the environment variables? So I have to build an image per environment, and per update to env vars.
- Use publicRuntimeConfig / getInitialProps but forget about SSG optimisation, even if my variables are non-sensitive (e.g. GA_TRACKING_ID)
- ... Is there anything else?
Thanks for your help!