I would like to run my Ember app in different environments/stages but with the same docker image. Until now I just compiled the app with the -prod flag and copied dist into my nginx image, but now I would like to use this image for production and staging and I need different configurations.
I am playing around with installing Ember CLI into my docker container so right now I am able to build the app with the --environment flag depending on an ENV variable upon container start-up and afterwards the dist directory is copied to the nginx root. This makes things more flexible but the container size exploded and the build itself is more complicated and thus possibly more error-prone.
I am wondering what is the preferred way to do that? In theory, the only thing that changes is the configuration in the index.html, so maybe I should pre-build all possible environments and copy the index.html(s) to the container?
I wrote an article How to dockerize an Ember app. The solution uses a single dockerfile and docker-compose to bring up the application stack in development and production; however, the production side of the tutorial isn’t detailed because production environments vary depending on who you talk to. Perhaps this is a good place for you to start?
a)development env inside docker container
b)test/QA/prod in docker containers.
c)both of the above?
d)multiple containers sourced from single image and ember app source code