unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.56k stars 480 forks source link

docker preset #54

Open pi0 opened 2 years ago

pi0 commented 2 years ago

Built with node and a minimal generated docker image:

Note: It might improve heroku preset as well (https://github.com/unjs/nitro/issues/49)

pi0 commented 2 years ago

Relevant comment https://github.com/nuxt/framework/pull/5077#issuecomment-1140166438 from @sarim, we might use or embed tini as init process to avoid using node with PID 0. (I need to investigate more)

mishushakov commented 2 years ago

hey @pi0, does this imply that the application will have to be built outside of Docker first? so the Dockerfile generated is only for deployment, correct?

in this case, i don't see it as being very useful the goal of Docker is reproducible builds and having to build the application outside of Docker goes against that

technically this means you'll have to setup a CI action to build the application and then another CI action to build the Dockerfile that won't work in many corporate CI-environments

in my experience things already work as is and currently i don't see a benefit of having a Docker preset a Dockerfile template, such as the one i provided in my PR covers 90% of use-cases already

one argument was that people use different package managers the solution would be just offering Dockerfile templates for each package manager

doesn't need to be more complicated that that! would be happy to hear your feedback