forked from Dokploy/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Added Nuxt server side and static example
- Loading branch information
1 parent
d707a27
commit b4669e8
Showing
10 changed files
with
9,663 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Nuxt dev/build outputs | ||
.output | ||
.data | ||
.nuxt | ||
.nitro | ||
.cache | ||
dist | ||
|
||
# Node dependencies | ||
node_modules | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Misc | ||
.DS_Store | ||
.fleet | ||
.idea | ||
|
||
# Local env files | ||
.env | ||
.env.* | ||
!.env.example |
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,60 @@ | ||
# Nuxt Example | ||
|
||
This repository contains an example of a Nuxt application that is deployed on Dokploy. There are two ways to deploy this application: | ||
|
||
- With server side rendering | ||
- As a static site | ||
|
||
All example assume you use `Nixpacks` as the build type. | ||
|
||
## Server side rendering | ||
|
||
1. **Use Git Provider in Your Application**: | ||
- Repository: `https://github.com/Dokploy/examples.git` | ||
- Branch: `main` | ||
- Build path: `/nuxt` | ||
|
||
2. **Add Environment Variables**: | ||
|
||
- Navigate to the "Environments" tab and add the following variable: | ||
|
||
```plaintext | ||
NIXPACKS_START_CMD="node .output/server/index.mjs" | ||
``` | ||
|
||
3. **Click on Deploy**: | ||
- Deploy your application by clicking the deploy button. | ||
|
||
4. **Generate a Domain**: | ||
- Click on generate domain button. | ||
- A new domain will be generated for you. | ||
- You can use this domain to access your application. | ||
|
||
## Static site | ||
|
||
1. **Use Git Provider in Your Application**: | ||
- Repository: `https://github.com/Dokploy/examples.git` | ||
- Branch: `main` | ||
- Build path: `/nuxt` | ||
|
||
2. **Add Environment Variables**: | ||
|
||
- Navigate to the "Environments" tab and add the following variable: | ||
|
||
```plaintext | ||
NIXPACKS_BUILD_CMD="npm run generate" | ||
``` | ||
|
||
3. **Set the publish publish directory**: | ||
|
||
- Ensure you set it to `dist/`. Note that there is no dot before `dist`! | ||
|
||
4. **Click on Deploy**: | ||
- Deploy your application by clicking the deploy button. | ||
|
||
5. **Generate a Domain**: | ||
- Click on generate domain button. | ||
- A new domain will be generated for you. | ||
- You can use this domain to access your application. | ||
|
||
If you need further assistance, join our [Discord server](https://discord.com/invite/2tBnJ3jDJc). |
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,6 @@ | ||
<template> | ||
<div> | ||
<NuxtRouteAnnouncer /> | ||
<NuxtWelcome /> | ||
</div> | ||
</template> |
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,5 @@ | ||
// https://nuxt.com/docs/api/configuration/nuxt-config | ||
export default defineNuxtConfig({ | ||
compatibilityDate: '2024-04-03', | ||
devtools: { enabled: true } | ||
}) |
Oops, something went wrong.