This commit is contained in:
Irwan Cahyono 2025-08-08 13:57:24 +07:00
parent 01a1bae275
commit 8a79a37d29
4 changed files with 17 additions and 17 deletions

View File

@ -8,7 +8,7 @@ RUN npm install --legacy-peer-deps
COPY . .
RUN npm run build
RUN npm run generate
# Dockerfile untuk server Nuxt 3
FROM nginx:1.29-alpine

View File

@ -2,20 +2,25 @@ server {
listen 80;
server_name localhost;
root /var/www/html;
index index.html;
location / {
root /var/www/html;
index index.html;
try_files $uri $uri/ /index.html;
}
location /_nuxt/ {
alias /var/www/html/_nuxt/;
expires 1y;
add_header Cache-Control "public";
}
location = /index.html {
expires -1;
add_header Cache-Control "no-store";
location ~ /\. {
deny all;
}
error_page 404 /index.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

View File

@ -76,14 +76,10 @@ export default defineNuxtConfig({
},
},
ssr: false,
// nitro: {
// preset: 'static', // Generate file static
// prerender: {
// failOnError: false, // Skip error saat generate
// ignore: ['/dynamic-route'], // Ignore route tertentu
// crawlLinks: false // Nonaktifkan crawler
// }
// },
ssr: false,
target: 'static',
generate: {
dir: '.output/public',
}
});

1
package-lock.json generated
View File

@ -3515,7 +3515,6 @@
},
"node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": {
"version": "1.1.0",
"dev": true,
"inBundle": true,
"license": "MIT"
},