I'm working with Angular 5, Nginx for my front app and Node.js for my backend. Everything will run in Docker.
I need to create multiple environments (staging, production,...) for the backend and the frontend. The back is easy, I use NODE_ENV
in my Docker compose. But what about the front?
Since I use Angular with AOT, serving the dist
folder in Nginx, I don't know how to dynamically change the env. The only solution I found for now is to build multiple version of the front with ng build --env=staging
, one by env, pushing each Docker image in the DTR and fetching those images by env name.
This is very cumbersome and I'm wondering if anyone encounter the same issue and found a better way. Or maybe the whole thing is a bad idea?
Any leads welcomed!