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:
6
nuxt/package-lock.json
generated
6
nuxt/package-lock.json
generated
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "nuxt",
|
|
||||||
"lockfileVersion": 3,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {}
|
|
||||||
}
|
|
||||||
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
|
# Coolify Configuration
|
||||||
|
|
||||||
1. Use `Nixpacks`.
|
## Dockerfile
|
||||||
2. Set `Ports Exposed` to `3000` (or any port you set).
|
|
||||||
3. Set `Start Command` to `node .output/server/index.mjs`
|
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.
|
- 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>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<NuxtRouteAnnouncer />
|
||||||
<NuxtWelcome />
|
<NuxtWelcome />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</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
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
|
compatibilityDate: '2025-07-15',
|
||||||
devtools: { enabled: true }
|
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",
|
"name": "nuxt-app",
|
||||||
"private": true,
|
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "nuxt build",
|
"build": "nuxt build",
|
||||||
"dev": "nuxt dev",
|
"dev": "nuxt dev",
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
"start": "node .output/server/index.mjs"
|
"start": "node .output/server/index.mjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nuxt": "^3.10.3",
|
"nuxt": "^4.2.2",
|
||||||
"vue": "^3.4.19",
|
"vue": "^3.5.26",
|
||||||
"vue-router": "^4.3.0"
|
"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
|
// 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"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
1
nuxt/static/.gitignore
vendored
1
nuxt/static/.gitignore
vendored
@@ -5,7 +5,6 @@
|
|||||||
.nitro
|
.nitro
|
||||||
.cache
|
.cache
|
||||||
dist
|
dist
|
||||||
.env
|
|
||||||
|
|
||||||
# Node dependencies
|
# Node dependencies
|
||||||
node_modules
|
node_modules
|
||||||
|
|||||||
11
nuxt/static/Dockerfile
Normal file
11
nuxt/static/Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
FROM node:24 AS build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json package-lock.json* ./
|
||||||
|
RUN npm ci
|
||||||
|
COPY . .
|
||||||
|
RUN npm run generate
|
||||||
|
|
||||||
|
FROM nginx
|
||||||
|
COPY --from=build /app/.output/public /usr/share/nginx/html
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
@@ -2,6 +2,37 @@
|
|||||||
|
|
||||||
Check [nuxt.config.js](./nuxt.config.js).
|
Check [nuxt.config.js](./nuxt.config.js).
|
||||||
|
|
||||||
1. Use `Nixpacks`.
|
## Dockerfile
|
||||||
2. Turn on `Is it a static site?`.
|
|
||||||
|
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 generate
|
||||||
|
|
||||||
|
FROM nginx
|
||||||
|
COPY --from=build /app/.output/public /usr/share/nginx/html
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Select `Dockerfile` as the `Build Pack` in Coolify.
|
||||||
|
3. Set `Ports Exposed` to `80`.
|
||||||
|
|
||||||
|
## Nixpacks
|
||||||
|
|
||||||
|
1. Create a `nixpacks.toml` file in the root of your project with the following content:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[phases.setup]
|
||||||
|
nixpkgsArchive = '51ad838b03a05b1de6f9f2a0fffecee64a9788ee'
|
||||||
|
aptPkgs = ["openssh-client"]
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Select `Nixpacks` as the `Build Pack` in Coolify.
|
||||||
|
3. Turn on `Is it a static site?`.
|
||||||
4. Set `Publish Directory` to `/.output/public`.
|
4. Set `Publish Directory` to `/.output/public`.
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<div style="padding: 20px; background: #f0f0f0; margin: 20px; border-radius: 8px;">
|
|
||||||
<h2>APP_URL:</h2>
|
|
||||||
<p>{{ config.public.appUrl }}</p>
|
|
||||||
</div>
|
|
||||||
<NuxtWelcome />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
const config = useRuntimeConfig()
|
|
||||||
</script>
|
|
||||||
6
nuxt/static/app/app.vue
Normal file
6
nuxt/static/app/app.vue
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<NuxtRouteAnnouncer />
|
||||||
|
<NuxtWelcome />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Validate SSH private key
|
|
||||||
if [ -n "$KEY" ]; then
|
|
||||||
echo "Validating SSH private key..."
|
|
||||||
|
|
||||||
# Create .ssh directory if it doesn't exist
|
|
||||||
mkdir -p ~/.ssh
|
|
||||||
chmod 700 ~/.ssh
|
|
||||||
|
|
||||||
# Write key to file
|
|
||||||
echo "$KEY" > ~/.ssh/id_rsa
|
|
||||||
chmod 600 ~/.ssh/id_rsa
|
|
||||||
cat ~/.ssh/id_rsa
|
|
||||||
|
|
||||||
# Validate the key
|
|
||||||
ssh-keygen -y -f ~/.ssh/id_rsa
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "✓ SSH private key is valid"
|
|
||||||
else
|
|
||||||
echo "✗ SSH private key is invalid"
|
|
||||||
rm -f ~/.ssh/id_rsa
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "⚠ KEY environment variable not set, skipping validation"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Continue with build
|
|
||||||
nuxt build
|
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
[phases.setup]
|
[phases.setup]
|
||||||
aptPkgs = ["openssh-client"]
|
nixpkgsArchive = '51ad838b03a05b1de6f9f2a0fffecee64a9788ee'
|
||||||
@@ -1,9 +1,16 @@
|
|||||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
|
compatibilityDate: "2025-07-15",
|
||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
|
nitro: {
|
||||||
|
prerender: {
|
||||||
|
crawlLinks: true,
|
||||||
|
routes: ["/"],
|
||||||
|
},
|
||||||
|
},
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
public: {
|
public: {
|
||||||
appUrl: process.env.APP_URL || 'something'
|
appUrl: process.env.APP_URL || "something",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|||||||
11680
nuxt/static/package-lock.json
generated
11680
nuxt/static/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "nuxt-app",
|
"name": "nuxt-app",
|
||||||
"private": true,
|
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "./build.sh",
|
"build": "nuxt build",
|
||||||
"dev": "nuxt dev",
|
"dev": "nuxt dev",
|
||||||
"generate": "nuxt generate",
|
"generate": "nuxt generate",
|
||||||
"preview": "nuxt preview",
|
"preview": "nuxt preview",
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
"start": "node .output/server/index.mjs"
|
"start": "node .output/server/index.mjs"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nuxt": "^3.10.3",
|
"nuxt": "^4.2.2",
|
||||||
"vue": "^3.4.19",
|
"vue": "^3.5.26",
|
||||||
"vue-router": "^4.3.0"
|
"vue-router": "^4.6.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
nuxt/static/public/robots.txt
Normal file
2
nuxt/static/public/robots.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
User-Agent: *
|
||||||
|
Disallow:
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../.nuxt/tsconfig.server.json"
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,18 @@
|
|||||||
{
|
{
|
||||||
// https://nuxt.com/docs/guide/concepts/typescript
|
// 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