DEV Community

How to Dockerize a React Application

Sh Raj on July 30, 2024

How to Dockerize a React Application Dockerizing a React application can streamline your development workflow, ensure consistent environ...
Collapse
 
abhideep_chakravarty_36c1 profile image
Abhideep Chakravarty

Who so ever wants to dockerize plain react application, he does not know how React works. It's useless to do so.

Collapse
 
sh20raj profile image
Sh Raj

I'm sorry brother for my previous reply

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
relcode profile image
Relebohile Nkosi

Is this how you talk every time someone does not agree with you?

Collapse
 
obed47 profile image
Obed47

You're a jerk.
This article is helpful but you paint it black for your own article which I doubt because your English is so bad.

Thread Thread
 
sh20raj profile image
Sh Raj

What do you wanna say ? English is not my primary language (know some english about coding)

Collapse
 
shreyanshsheth profile image
Shreyansh sheth

For plain simple react application you don't need docker, and also if you are using docker the way you have used it is not optimized.

Suggestion

  1. If you don't have knowledge about how cra works please look though it. ( basically it gives you static assets)
  2. You have to add build steps for docker file, why are you shipping node_modules in final build
  3. Also use latest version of node and use vite insted of cra.

PS: we all make mistakes by not understanding proper requirements and optimized way to deploy thing but you can always research.

Collapse
 
joset98 profile image
joset98

Thanks dude this was simple and clean, blessings to you

Collapse
 
rebeccapeltz profile image
Rebeccca Peltz

Excellent post! Thank you.

Collapse
 
sh20raj profile image
Sh Raj

Your Welcome

Collapse
 
satya277 profile image
Satya Prakash Parija

Does docker help in microservices....asking as a noob