From d3d44dacdba64c31caee2e89a5a0c0a0dd515d0d Mon Sep 17 00:00:00 2001 From: Irwan Cahyono Date: Thu, 7 Aug 2025 22:28:48 +0700 Subject: [PATCH] cobalagi --- Dockerfile | 4 +++- docker-compose.yml | 2 +- nginx.conf | 10 ++++++++++ nuxt.config.ts | 7 ------- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index c431b0d..70803dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,9 +16,11 @@ RUN test -f .output/public/index.html # Gunakan NGINX untuk menyajikan SPA FROM nginx:1.29.0-alpine-slim +RUN rm -rf /usr/share/nginx/html/* + RUN rm /etc/nginx/conf.d/default.conf -COPY --from=builder /app/.output/public /usr/share/nginx/html +COPY --from=builder /app/dsit /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 diff --git a/docker-compose.yml b/docker-compose.yml index 15447d3..6d67e43 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: nuxt-app: build: . - container_name: nuxt-container + container_name: freekake-nuxt-container ports: - "3000:80" env_file: diff --git a/nginx.conf b/nginx.conf index 7a69c22..4d34b69 100644 --- a/nginx.conf +++ b/nginx.conf @@ -9,5 +9,15 @@ server { try_files $uri $uri/ /index.html; } + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + expires 7d; + access_log off; + add_header Cache-Control "public"; + } + + location ~ /\. { + deny all; + } + error_page 404 /index.html; } diff --git a/nuxt.config.ts b/nuxt.config.ts index 1b1ee2d..1f04bf9 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -73,12 +73,5 @@ export default defineNuxtConfig({ }, ssr: false, - nitro: { - prerender: { - crawlLinks: false, - routes: [] - } - } - }); \ No newline at end of file