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:
1
nuxt/static/.gitignore
vendored
1
nuxt/static/.gitignore
vendored
@@ -5,7 +5,6 @@
|
||||
.nitro
|
||||
.cache
|
||||
dist
|
||||
.env
|
||||
|
||||
# Node dependencies
|
||||
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).
|
||||
|
||||
1. Use `Nixpacks`.
|
||||
2. Turn on `Is it a static site?`.
|
||||
## 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 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`.
|
||||
|
||||
@@ -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]
|
||||
aptPkgs = ["openssh-client"]
|
||||
[phases.setup]
|
||||
nixpkgsArchive = '51ad838b03a05b1de6f9f2a0fffecee64a9788ee'
|
||||
@@ -1,9 +1,16 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
compatibilityDate: "2025-07-15",
|
||||
devtools: { enabled: true },
|
||||
nitro: {
|
||||
prerender: {
|
||||
crawlLinks: true,
|
||||
routes: ["/"],
|
||||
},
|
||||
},
|
||||
runtimeConfig: {
|
||||
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",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "./build.sh",
|
||||
"build": "nuxt build",
|
||||
"dev": "nuxt dev",
|
||||
"generate": "nuxt generate",
|
||||
"preview": "nuxt preview",
|
||||
@@ -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/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
|
||||
"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