dockersamples/example-voting-app

Having CMD and command

janus opened this issue · 1 comments

janus commented

I noticed that Dockerfile inside result folder has this CMD ["node", "server.js"] and the docker-compose.yml has a result service that has this command: nodemon server.js. Are they not do same thing? I do know the advantage of nodemon during development.

Nodemon does many things, but mainly it's a file watcher that will restart the node server when you save a file. You wouldn't use it in production, which is why we override the CMD in the compose file for local development.