feat: coolify preset
A Nitro Coolify preset to standardise and improve security when deploying to Coolify. Attached issue 2762.
โ Type of change
Docs and Preset for Coolify.
- [ x ] โจ New feature (a non-breaking change that adds functionality)
- [ x ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
๐ Description
As discussed earlier over multiple channels with pi0 this is the right step moving forward.
Requesting feedback, the preset now correctly adds the start script to the output package.json.
๐ Checklist
- [X] I have linked an issue or discussion.
- [X] I have updated the documentation accordingly.
Currently I wouldn't call this a Coolify preset but rather a Nixpacks preset, since it has more to do with the latter compared to Coolify.
In particular, because if someone during a Coolify deployment picks a different Build Pack, this preset will be just useless or might become counterproductive in future versions.
To add onto this, since we are talking to a dedicated Nixpacks preset, we could create a dedicated nixpacks.toml or nixpacks.json configuration file solely for proper Nitro/Nuxt deployments. Coping into the final image only the required folders and files (eg: .output).
While this is still not as optimized Dockerfile+Alpine images, it is still an improvement. With a downside that I still have no idea how to handle additional folders like content from @nuxt/content.
Thanks for your pull-request dear @justserdar and feedback @sandros94.
Few notes:
- Please read nitro core principles in detail i have tried to explain.
- #2762 is requires nitro + "coolify" recommended deployment method regardless of details. nixpacks/decker could be another preset we extend from but it is a detail.
- We still have to find a way to deploy build output directory. Not project root. Build output is generated from framework output. nuxt or nuxt content generated their artifacts is within this directory.
As we take this step by step, I feel the PR is currently at the point of: Preset:
- [x] Append 'start' script.
- [ ] Solution for handling the build output directory.
Docs:
- [x] Steps to get started in Coolify using Nixpacks (server)
- [ ] Steps to get started in Coolify using Nixpacks (static)
- [ ] Steps to get started in Coolify using Docker (server/static)
Would love feedback/input.