angular app with docker - production & development angular app with docker - production & development docker docker

angular app with docker - production & development


Your ideas seems ok. I generally create a bash script(as for me it's flexible enough) to deploy different environments according to requirement(dev&prod).

Assumed created a bash script deployApp.sh

sh deployApp.sh `{dev or prod}`

So you can also create(or switch) Dockerfile on the fly according to your environment and build your app with this Dockerfile. So you can manage your prod environment requirements(only deploy to nginx with webpack's created bundles etc.) what you need respectively.

An example about creating deployApp.sh:

webpack `{if other required parameters here}`  #created bundle.js etc.#After webpack operations , choose Dockerfile for prod or dev : #./prod/Dockerfile , ./dev/Dockerfile#check if first parameter is prod or devdocker build -f ./prod/Dockerfile  #this will build nginx based container #and copy needed files&folders

That is just an approach according to your idea, also i use like that approach. You just create that setup one time. Also you can apply another projects If it is suitable.