I've been trying to set up a Docker environment, where the frontend (Angular/TypeScript in our case) is built in the Docker file and then served through Nginx.
We want to keep the Docker images environment-agnostic (so we can change our environment without having to rebuild the images). This means we can't build the code with environment variables. So far the options we see are:
- inject the values on serving the code (probably some performance impact, don't know any neat way of doing this)
- still build separate images (& drop our requirement)
- have all environments compiled into the code with
environment.<env>.ts
files (not really agnostic images, just between a static set of environments)
Is there any recommended method of doing this? Am I missing something? I feel like this should be a solved problem, but I can't find anything on how to do this "properly".