DEV Community

loading...

Discussion on: Frontend Development with Docker simplified

Collapse
victorioberra profile image
Victorio Berra

So im having trouble getting mine to work. I just created a plain index.js with console.log('hello world'), my startup script says nodemon index.js which successfully runs the index file and monitors for changes. But when I change the index.js in VSCode it never updates in the container. It just says "watching for changes before restart". This works locally BTW, if I change the index running without docker, it detects the change and updates. Is something wrong with my volumes? I set COMPOSE_CONVERT_WINDOWS_PATHS=1

Collapse
blacksonic profile image
Gábor Soós Author

I've tested the setup again with Vue CLI and it detects changes. Next week I'll be working on the Node.js workflow.

Collapse
blacksonic profile image
Gábor Soós Author

Can you show an example repo?

Collapse
victorioberra profile image
Victorio Berra

Sorry it took so long for me to get back to you, here is the repo github.com/VictorioBerra/docker-co...

You should just have to clone and run docker-compose up and then edit the index.js and notice nodemon never sees the file change, and does not restart the process.

Thread Thread
blacksonic profile image
Gábor Soós Author

In the meantime, I've put together a working Node.js Express app setup that rebuilds with Nodemon on file changes github.com/blacksonic/node-docker-...

Thread Thread
blacksonic profile image
Gábor Soós Author

I don't know what is watched by Nodemon with the default setting, but to be sure I've specified what to watch, maybe that is the missing piece in your code.

Thread Thread
victorioberra profile image