feat: update Dockerfile

This commit is contained in:
hanif salafi 2025-07-03 21:18:02 +07:00
parent cd30bc4561
commit cabd73822f
1 changed files with 4 additions and 5 deletions

View File

@ -5,7 +5,7 @@ FROM node:23.5.0-alpine
ENV PORT 3000 ENV PORT 3000
# Install pnpm secara global # Install pnpm secara global
RUN npm install -g npm RUN npm install -g pnpm
# Membuat direktori aplikasi dan mengatur sebagai working directory # Membuat direktori aplikasi dan mengatur sebagai working directory
WORKDIR /usr/src/app WORKDIR /usr/src/app
@ -17,18 +17,17 @@ COPY package.json ./
COPY vendor/ckeditor5 ./vendor/ckeditor5 COPY vendor/ckeditor5 ./vendor/ckeditor5
# Install dependencies # Install dependencies
RUN npm install RUN pnpm install
# RUN pnpm install --frozen-lockfile # RUN pnpm install --frozen-lockfile
# Menyalin source code aplikasi # Menyalin source code aplikasi
COPY . . COPY . .
# Build aplikasi # Build aplikasi
# RUN NODE_OPTIONS="--max-old-space-size=4096" npm run build RUN NODE_OPTIONS="--max-old-space-size=4096" pnpm next build
RUN npm run build
# Expose port untuk server # Expose port untuk server
EXPOSE 3000 EXPOSE 3000
# Perintah untuk menjalankan aplikasi # Perintah untuk menjalankan aplikasi
CMD ["npm", "run", "start"] CMD ["pnpm", "run", "start"]