Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
MrMarco2994y@magicMirror I am finding the whole node_modules thing to use insane amounts of CPU when it's Dockerized, even more than usual. And the hot reloading is buggy and it sucks
-
10Dev28534y@MrMarco you shouldn't a hot reload in a dockerized app
Docker is meant for deploys, not for development -
Yeesh. 🤦♂️.
You can use Docker to develop nodejs. just map the project directory on the host, to the docker.
Thrn restart the server as required. Hot reload is nice option when you work like that, and any changes to the node modules that you do inside the container will be persisted. -
I just set this up with webpack, so here's a few lessons I learned:
1. When you want hot reload, proxy everything you don't recognize to WDS after routing the api and such.
2. Turn node_modules into its own volume that isn't a host directory, so that docker can be efficient with the caching. (I only suspect this is the cause but directory mounts are about half as fast for me)
3. Check for permission errors, there's a lot of them. -
Also use a static file server other than node. A caddy config to serve file if exists else proxy is like 4 lines.
Related Rants
Is it just me or do Nodejs apps just completely hate to be Dockerized?
rant
docker
js
nodejs