freeCodeCamp / publish

> Content backend platform for /news
https://publish.freecodecamp.org
BSD 3-Clause "New" or "Revised" License
10 stars 9 forks source link

Make Docker image compatible with multiple environments #361

Open sidemt opened 7 months ago

sidemt commented 7 months ago

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 fix the issue, we have to either:

Reference: https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables#runtime-environment-variables