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.
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
indocker-compose.yml
but when I start usingdocker-compose up --build
it says that dependencies are not installed.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. 🤟
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?
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.