spa
This commit is contained in:
parent
01a1bae275
commit
8a79a37d29
@ -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
|
||||
|
||||
17
nginx.conf
17
nginx.conf
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,13 +77,9 @@ 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
|
||||
// }
|
||||
// },
|
||||
target: 'static',
|
||||
generate: {
|
||||
dir: '.output/public',
|
||||
}
|
||||
|
||||
});
|
||||
1
package-lock.json
generated
1
package-lock.json
generated
@ -3515,7 +3515,6 @@
|
||||
},
|
||||
"node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": {
|
||||
"version": "1.1.0",
|
||||
"dev": true,
|
||||
"inBundle": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user