I am using ECR to store an Angular app that goes in as an image. Now I have keys, URLs, etc that I wish to access inside the container running on ECS, passed through in the ECS container definitions.
I have tried dotenv
that dynamically picks up env variables and write the file environment.ts
everytime you do an npm start
but the issue with this is, that when an image is being built it is again hardcoded in the file and not something that is being accessed through a containers environment, where the ECS environment variables are.
I have no idea how to do that since process.env
does not work in an angular environment, and I believe it won't work either since the Angular app is essentially just HTML, CSS, and JS after being built (No node server whatsoever).
So, In such a scenario, How do I even make environment variables work?