From c66427544fff39dee257ee02d5c90cf05f7c8860 Mon Sep 17 00:00:00 2001 From: Anang Yusman Date: Tue, 30 Dec 2025 19:56:50 +0800 Subject: [PATCH] update --- Dockerfile | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2b874db..076d551 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,36 +1,24 @@ -# Menggunakan image Node.js yang lebih ringan -FROM node:23.5.0-alpine +FROM node:21-alpine -# Mengatur port -ENV PORT 3000 +ENV PORT 4000 -# Install pnpm secara global -RUN npm install -g pnpm - -# Membuat direktori aplikasi dan mengatur sebagai working directory +# Create app directory +RUN mkdir -p /usr/src/app WORKDIR /usr/src/app -# Menyalin file penting terlebih dahulu untuk caching -COPY package.json ./ +# Installing dependencies +COPY package*.json /usr/src/app/ -# Menyalin direktori ckeditor5 jika diperlukan -COPY vendor/ckeditor5 ./vendor/ckeditor5 +# RUN npm install --force +RUN npm install --legacy-peer-deps +RUN npm install -# Menyalin env -COPY .env .env +# Copying source files +COPY . /usr/src/app -# Install dependencies -RUN pnpm install -# RUN pnpm install --frozen-lockfile +# Building app +RUN npm run build +EXPOSE 4000 -# Menyalin source code aplikasi -COPY . . - -# Build aplikasi -RUN NODE_OPTIONS="--max-old-space-size=4096" pnpm next build - -# Expose port untuk server -EXPOSE 3000 - -# Perintah untuk menjalankan aplikasi -CMD ["pnpm", "run", "start"] \ No newline at end of file +# Running the app +CMD "npm" "run" "start"