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 _; \