nareshbhatia / proshop-nx

Sample shopping app using the Nx monorepo
proshop-nx-catalog.vercel.app
2 stars 0 forks source link

Multi-stage Docker images #3

Open themegaphoenix opened 2 years ago

themegaphoenix commented 2 years ago

Ideally you want your docker images to be as light as possible.

Looking at your react applications DockerFile, this is not the case as all the npm packages are already included in the final package. The only thing you need from the build process is the build folder.

Have a look at this: https://tiangolo.medium.com/react-in-docker-with-nginx-built-with-multi-stage-docker-builds-including-testing-8cc49d6ec305

I could do a PR request with this change but this your learning project and hence I will leave this for you to learn

nareshbhatia commented 2 years ago

Excellent point! And yes, since this is a learning project for me, let me give it a shot. I will let you know if I have further questions.