DEV Community

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

Collapse
 
jnoelvictorino profile image
John Noel Victorino

Hi Vikas,

Thank you for a great series of articles. This has been helpful to me since I am a beginner in React and Node, but I have some experience with Docker.

I tried the basic setup from your article. But when I make changes to the frontend, I cannot see it in the browser.

I tried to add volumes in docker-compose.yml but when I start using docker-compose up --build it says that dependencies are not installed.

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.