mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-02-18 21:38:58 +00:00
chore: update nuxt examples
This commit is contained in:
14
nuxt/server/Dockerfile
Normal file
14
nuxt/server/Dockerfile
Normal 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"]
|
||||
@@ -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.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<NuxtRouteAnnouncer />
|
||||
<NuxtWelcome />
|
||||
</div>
|
||||
</template>
|
||||
2
nuxt/server/nixpacks.toml
Normal file
2
nuxt/server/nixpacks.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[phases.setup]
|
||||
nixpkgsArchive = '51ad838b03a05b1de6f9f2a0fffecee64a9788ee'
|
||||
@@ -1,4 +1,5 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
compatibilityDate: '2025-07-15',
|
||||
devtools: { enabled: true }
|
||||
})
|
||||
|
||||
11680
nuxt/server/package-lock.json
generated
11680
nuxt/server/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
nuxt/server/public/robots.txt
Normal file
2
nuxt/server/public/robots.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
User-Agent: *
|
||||
Disallow:
|
||||
@@ -1,3 +0,0 @@
|
||||
export default defineEventHandler((event) => {
|
||||
return 'OK'
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": "../.nuxt/tsconfig.server.json"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user