feat: update dockerfile

This commit is contained in:
hanif salafi 2025-01-05 00:32:21 +07:00
parent a4bdf34edd
commit 42d613db6e
1 changed files with 17 additions and 17 deletions

View File

@ -1,32 +1,32 @@
# Menggunakan image Node.js yang lebih ringan
FROM node:23.5.0-alpine FROM node:23.5.0-alpine
# Mengatur port
ENV PORT 3000 ENV PORT 3000
# Install pnpm globally # Install pnpm secara global
RUN npm install -g pnpm RUN npm install -g pnpm
# Create app directory # Membuat direktori aplikasi dan mengatur sebagai working directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app WORKDIR /usr/src/app
# Installing dependencies # Menyalin file penting terlebih dahulu untuk caching
COPY package*.json pnpm-lock.yaml* /usr/src/app/ COPY package.json pnpm-lock.yaml ./
COPY vendor/ckeditor5 /usr/src/app/
# Install dependencies using pnpm # Install dependencies
# RUN npm install next --legacy-peer-deps RUN pnpm install --frozen-lockfile
RUN pnpm install
# RUN pnpm add next-intl
# RUN pnpm add nextra
# RUN pnpm add @next/bundle-analyzer
# Menyalin direktori ckeditor5 jika diperlukan
COPY vendor/ckeditor5 ./vendor/ckeditor5
# Copying source files # Menyalin source code aplikasi
COPY . /usr/src/app COPY . .
# Building app # Build aplikasi
RUN pnpm run build RUN pnpm run build
# Expose port untuk server
EXPOSE 3000 EXPOSE 3000
# Running the app # Perintah untuk menjalankan aplikasi
CMD ["pnpm", "run", "start"] CMD ["pnpm", "run", "start"]