From e8f8b5eb9d4b6bb5b5f91888e08584939d28bc7d Mon Sep 17 00:00:00 2001 From: Irwan Cahyono Date: Thu, 7 Aug 2025 12:28:33 +0700 Subject: [PATCH] perbaikan docker --- Dockerfile | 5 ++--- nginx.conf | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 935693b..16136be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,10 +13,9 @@ RUN npm run build # Gunakan NGINX untuk menyajikan SPA FROM nginx:1.29.0-alpine-slim -# Salin hasil build ke folder root nginx -COPY --from=builder /app/.output/public /usr/share/nginx/html +RUN rm /etc/nginx/conf.d/default.conf -# Salin konfigurasi khusus NGINX untuk SPA (opsional tapi direkomendasikan) +COPY --from=builder /app/.output/public /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 diff --git a/nginx.conf b/nginx.conf index cbb6356..7a69c22 100644 --- a/nginx.conf +++ b/nginx.conf @@ -8,4 +8,6 @@ server { location / { try_files $uri $uri/ /index.html; } + + error_page 404 /index.html; }