Open
Description
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
- We are passing in the variable at the build time here:
publish/.github/workflows/build.yml
Lines 36 to 41 in 8d1a173
- We are passing in the variable at the build time here:
To fix the issue, we have to either:
- use
getServerSideProps
- use App Router
- if we can't avoid using
NEXT_PUBLIC_
variable, build the frontend Docker image for each environment
Metadata
Assignees
Labels
No labels