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
# Mengatur port
ENV PORT 3000
# Install pnpm globally
# Install pnpm secara global
RUN npm install -g pnpm
# Create app directory
RUN mkdir -p /usr/src/app
# Membuat direktori aplikasi dan mengatur sebagai working directory
WORKDIR /usr/src/app
# Installing dependencies
COPY package*.json pnpm-lock.yaml* /usr/src/app/
COPY vendor/ckeditor5 /usr/src/app/
# Menyalin file penting terlebih dahulu untuk caching
COPY package.json pnpm-lock.yaml ./
# Install dependencies using pnpm
# RUN npm install next --legacy-peer-deps
RUN pnpm install
# RUN pnpm add next-intl
# RUN pnpm add nextra
# RUN pnpm add @next/bundle-analyzer
# Install dependencies
RUN pnpm install --frozen-lockfile
# Menyalin direktori ckeditor5 jika diperlukan
COPY vendor/ckeditor5 ./vendor/ckeditor5
# Copying source files
COPY . /usr/src/app
# Menyalin source code aplikasi
COPY . .
# Building app
# Build aplikasi
RUN pnpm run build
# Expose port untuk server
EXPOSE 3000
# Running the app
CMD ["pnpm", "run", "start"]
# Perintah untuk menjalankan aplikasi
CMD ["pnpm", "run", "start"]