This commit is contained in:
Anang Yusman 2025-09-22 22:30:47 +08:00
parent c3da5edf46
commit e505a16a26
1 changed files with 8 additions and 6 deletions

View File

@ -4,8 +4,9 @@ FROM node:23.5.0-alpine
# Mengatur port # Mengatur port
ENV PORT 3000 ENV PORT 3000
# Install pnpm secara global # RUN npm install --force
RUN npm install -g pnpm RUN npm install --legacy-peer-deps
RUN npm install
# 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,20 +18,21 @@ COPY package.json ./
COPY vendor/ckeditor5 ./vendor/ckeditor5 COPY vendor/ckeditor5 ./vendor/ckeditor5
# Menyalin env # Menyalin env
COPY .env .env # COPY .env .env
# Install dependencies # Install dependencies
RUN pnpm install RUN npm 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" pnpm next build RUN npm run build
# RUN NODE_OPTIONS="--max-old-space-size=4096" pnpm next build
# Expose port untuk server # Expose port untuk server
EXPOSE 3000 EXPOSE 3000
# Perintah untuk menjalankan aplikasi # Perintah untuk menjalankan aplikasi
CMD ["pnpm", "run", "start"] CMD ["npm" "run" "start"]