Relative Content

Tag Archive for dockernext.jsdocker-compose

Next.js docker compose – passing environment variable during build time

Next.js app bundles the env variables during build time. That’s why I need to pass env variables as args and used them during the build stage.
Now as part of the CD/CI pipeline I want to pass args dynamically via environment variables declared in compose.yaml.
However, the env variable from compose file are not read during build time. In fact, the terminal prints the following message: