Listen to changes and reload container on code change - docker-compose

后端 未结 2 1538
终归单人心
终归单人心 2021-02-19 07:42

I am using docker-compose in visual studio 2019 with docker for windows running linux containers. I want to enable hot reload for the angular client app.

I modified the

2条回答
  •  醉话见心
    2021-02-19 08:33

    Use nodemon to automatically restart the node server when code is changed . Before that install nodemon in your docker image and make sure it is present.

    Refer this URL to install nodemon :https://www.npmjs.com/package/nodemon

    then change your CMD in Dockerfile

    CMD ["nodemon", "--exec", "npm", "run", "docker-start"]
    

    This is reload your nodejs application whenever codes are changed

提交回复
热议问题