Currently, we are using an environment variable NEXT_PUBLIC_STRAPI_BACKEND_URL in the frontend app.
But this variable gets fixed at build time, making the Docker image only compatible with a single environment.
Current situation:
To make an environment variable accessible in the browser, we have to prefix the variable with NEXT_PUBLIC_
But by doing so, the value will be fixed at build time -> this is causing the problem now
Currently, we are using an environment variable
NEXT_PUBLIC_STRAPI_BACKEND_URL
in the frontend app. But this variable gets fixed at build time, making the Docker image only compatible with a single environment.Current situation:
NEXT_PUBLIC_
To fix the issue, we have to either:
getServerSideProps
NEXT_PUBLIC_
variable, build the frontend Docker image for each environmentReference: https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables#runtime-environment-variables