From 193bb427d2e68af8e9fc0c693edb4a736a3db3c3 Mon Sep 17 00:00:00 2001 From: rheiga19 Date: Wed, 26 Mar 2025 22:42:17 +0700 Subject: [PATCH] fixing dockerfile --- deploy/docker/Dockerfile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/deploy/docker/Dockerfile b/deploy/docker/Dockerfile index d8b0d54..b5bbf5c 100644 --- a/deploy/docker/Dockerfile +++ b/deploy/docker/Dockerfile @@ -3,23 +3,27 @@ FROM node:20-alpine as build WORKDIR /app -# Copy package files and install dependencies -COPY package.json package-lock.json* ./ -RUN npm ci +# Tambahkan dependensi yang mungkin dibutuhkan +RUN apk add --no-cache python3 make g++ git -# Copy the rest of the application code +# Copy package files dan install dependencies +COPY package.json package-lock.json* ./ +# Gunakan --legacy-peer-deps untuk mengatasi masalah kompatibilitas +RUN npm ci --legacy-peer-deps || npm install --legacy-peer-deps + +# Copy kode aplikasi COPY . . -# Build the application +# Build aplikasi RUN npm run build # Production stage FROM nginx:alpine -# Copy the built files from the build stage to nginx +# Copy file hasil build ke nginx COPY --from=build /app/dist /usr/share/nginx/html -# Create a custom nginx configuration that handles SPA routing +# Buat konfigurasi nginx untuk SPA routing RUN echo 'server { \ listen 80; \ server_name _; \