DEV Community

Discussion on: Running React and Node.js in one shot with Docker!

Collapse
 
numtostr profile image
Vikas Raj

Oh, I get it. Before doing compose you need to install dependecies in both i.e. client and server project.

Because in Dockerfile there is nothing related to installation. All the magic happens in the compose file. It mounts the local directory inside the container will all the packages i.e. node_modules.

I hope this helps. 🤟

Collapse
 
jnoelvictorino profile image
John Noel Victorino

Thank you for the reply. Does this mean I have to install npm in local host machine?
Would there be a way to bypass this if that is the case?

Thread Thread
 
numtostr profile image
Vikas Raj

Yes, you need install on the local machine.

If you don't wanna do this. Then you have to modify the Dockerfile to add the installation process inside the container.