chore: update nuxt examples

This commit is contained in:
Cinzya
2025-12-28 19:11:25 +01:00
parent be12308526
commit 55fe4b24cf
25 changed files with 12333 additions and 11274 deletions

14
nuxt/server/Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM node:24 AS build
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:24
WORKDIR /app
COPY --from=build /app/.output/ ./
ENV PORT=3000
ENV HOST=0.0.0.0
EXPOSE 3000
CMD ["node", "/app/server/index.mjs"]

View File

@@ -1,6 +1,40 @@
# Coolify Configuration
1. Use `Nixpacks`.
2. Set `Ports Exposed` to `3000` (or any port you set).
3. Set `Start Command` to `node .output/server/index.mjs`
## Dockerfile
1. Create a `Dockerfile` in the root of your project with the following content:
```Dockerfile
FROM node:24 AS build
WORKDIR /app
COPY package.json package-lock.json\* ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:24
WORKDIR /app
COPY --from=build /app/.output/ ./
ENV PORT=3000
ENV HOST=0.0.0.0
EXPOSE 3000
CMD ["node", "/app/server/index.mjs"]
```
2. Select `Dockerfile` as the `Build Pack` in Coolify.
3. Set `Ports Exposed` to `3000` (or any port you set).
4. Set `Dockerfile Location` to the location of your `Dockerfile` (e.g., `/Dockerfile`).
## Nixpacks
1. Create a `nixpacks.toml` file in the root of your project with the following content:
```toml
[phases.setup]
nixpkgsArchive = '51ad838b03a05b1de6f9f2a0fffecee64a9788ee'
```
2. Select `Nixpacks` as the `Build Pack` in Coolify.
3. Set `Ports Exposed` to `3000` (or any port you set).
4. Set `Start Command` to `node .output/server/index.mjs`
- Alternatively, you can set the `start` script inside `package.json` to `node .output/server/index.mjs`. Then Nixpacks will automatically use it as the start command.

View File

@@ -1,5 +1,6 @@
<template>
<div>
<NuxtRouteAnnouncer />
<NuxtWelcome />
</div>
</template>

View File

@@ -0,0 +1,2 @@
[phases.setup]
nixpkgsArchive = '51ad838b03a05b1de6f9f2a0fffecee64a9788ee'

View File

@@ -1,4 +1,5 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2025-07-15',
devtools: { enabled: true }
})

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"name": "nuxt-app",
"private": true,
"type": "module",
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
@@ -11,8 +11,8 @@
"start": "node .output/server/index.mjs"
},
"dependencies": {
"nuxt": "^3.10.3",
"vue": "^3.4.19",
"vue-router": "^4.3.0"
"nuxt": "^4.2.2",
"vue": "^3.5.26",
"vue-router": "^4.6.4"
}
}
}

View File

@@ -0,0 +1,2 @@
User-Agent: *
Disallow:

View File

@@ -1,3 +0,0 @@
export default defineEventHandler((event) => {
return 'OK'
})

View File

@@ -1,3 +0,0 @@
{
"extends": "../.nuxt/tsconfig.server.json"
}

View File

@@ -1,4 +1,18 @@
{
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json"
"files": [],
"references": [
{
"path": "./.nuxt/tsconfig.app.json"
},
{
"path": "./.nuxt/tsconfig.server.json"
},
{
"path": "./.nuxt/tsconfig.shared.json"
},
{
"path": "./.nuxt/tsconfig.node.json"
}
]
}