fix
This commit is contained in:
parent
c382724044
commit
6eae36011d
39
Dockerfile
39
Dockerfile
|
|
@ -1,31 +1,36 @@
|
||||||
|
# Menggunakan image Node.js yang lebih ringan
|
||||||
FROM node:23.5.0-alpine
|
FROM node:23.5.0-alpine
|
||||||
|
|
||||||
# Tambah dependency penting untuk build
|
# Mengatur port
|
||||||
RUN apk add --no-cache libc6-compat
|
|
||||||
|
|
||||||
# Set port
|
|
||||||
ENV PORT 3000
|
ENV PORT 3000
|
||||||
|
|
||||||
# Set working directory
|
# Install pnpm secara global
|
||||||
|
RUN npm install -g pnpm
|
||||||
|
|
||||||
|
# Membuat direktori aplikasi dan mengatur sebagai working directory
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Copy package.json dan lockfile
|
# Menyalin file penting terlebih dahulu untuk caching
|
||||||
COPY package*.json ./
|
COPY package.json ./
|
||||||
|
|
||||||
# Install dependencies
|
# Menyalin direktori ckeditor5 jika diperlukan
|
||||||
RUN npm ci
|
|
||||||
|
|
||||||
# Copy vendor ckeditor kalau perlu
|
|
||||||
COPY vendor/ckeditor5 ./vendor/ckeditor5
|
COPY vendor/ckeditor5 ./vendor/ckeditor5
|
||||||
|
|
||||||
# Copy semua source code
|
# Menyalin env
|
||||||
|
COPY .env .env
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN pnpm install
|
||||||
|
# RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
# Menyalin source code aplikasi
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build Next.js
|
# Build aplikasi
|
||||||
RUN npm run build --debug
|
RUN NODE_OPTIONS="--max-old-space-size=4096" pnpm next build
|
||||||
|
|
||||||
# Expose port
|
# Expose port untuk server
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
# Start app
|
# Perintah untuk menjalankan aplikasi
|
||||||
CMD ["npm", "run", "start"]
|
CMD ["pnpm", "run", "start"]
|
||||||
Loading…
Reference in New Issue