-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: coolify preset #2767
Draft
justserdar
wants to merge
3
commits into
nitrojs:v2
Choose a base branch
from
justserdar:coolify-preset
base: v2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+83
−6
Draft
feat: coolify preset #2767
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Coolify | ||
|
||
> Deploy Nitro apps to [Coolify](https://coolify.io). | ||
**Preset:** `coolify` | ||
|
||
:read-more{title="coolify.io" to="https://coolify.io/docs/"} | ||
|
||
::note | ||
This is the recommended preset for Coolify deployments. | ||
:: | ||
|
||
Coolify supports deploying both static and server-side rendered apps with zero configuration. | ||
|
||
## Set up your web app | ||
|
||
In your project, set Nitro preset to `coolify`. | ||
|
||
```js | ||
export default { | ||
nitro: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This config works in nuxt only + it is boilerplate (ie: provider fixed in project) |
||
preset: 'coolify' | ||
} | ||
} | ||
``` | ||
|
||
## Getting started | ||
|
||
1. Log in to Coolify dashboard and create a new project. | ||
2. Select GitHub App and repository, then click "Load Repository". | ||
3. Set `Build Pack` to `nixpacks` and `Port` to `3000`. | ||
4. Enable healthchecks in project sidebar. | ||
5. Add environment variables if needed. | ||
6. Click "Deploy". | ||
|
||
You're all set up! | ||
|
||
When you push changes to your repository, Coolify will automatically rebuild your app. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { defineNitroPreset } from "nitropack/kit"; | ||
import { updatePackageJSON } from "./utils"; | ||
import type { Nitro } from "nitropack/types"; | ||
const coolify = defineNitroPreset( | ||
{ | ||
extends: "node-server", | ||
hooks: { | ||
async compiled(nitro: Nitro) { | ||
await updatePackageJSON(nitro); | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: "coolify" as const, | ||
url: import.meta.url, | ||
} | ||
); | ||
|
||
export default [ | ||
coolify | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Nitro } from "nitropack/types"; | ||
import { join } from "pathe"; | ||
import { readPackageJSON, writePackageJSON } from "pkg-types"; | ||
|
||
export async function updatePackageJSON(nitro: Nitro) { | ||
const packageJSONPath = join(nitro.options.output.serverDir, "package.json"); | ||
const packageJSON = await readPackageJSON(packageJSONPath); | ||
await writePackageJSON(packageJSONPath, { | ||
...packageJSON, | ||
scripts: { | ||
...packageJSON.scripts, | ||
start: "node ./server/index.mjs" | ||
}, | ||
}); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, we should instruct the build commands to use
SERVER_PRESET=coolify
environment variable.