Closed r44cx closed 3 months ago
Option 1: Server Action Option 2: SSR for Frontend Option 3: Build on Deployment Option 4: Dockerfile:
...
CMD ["/start.sh"]
start.sh:
sed -i "s/PLACEHOLDER_ENV/${MY_ENV_VAR}/g" /app/.next/static/*.js
npm run start
The order of the options also represents my preference for the solution.
We go with Option 1. Server Action
We will come up with a solution to this problem. As the env resolve is happening during build and not runtime. But we don't want to build the app during container startup or include it into the docker image.