update
This commit is contained in:
parent
0c3f13e734
commit
c9bef4e061
29
Dockerfile
29
Dockerfile
|
|
@ -1,38 +1,29 @@
|
||||||
# Menggunakan image Node.js yang lebih ringan
|
# Gunakan image Node.js yang ringan
|
||||||
FROM node:23.5.0-alpine
|
FROM node:23.5.0-alpine
|
||||||
|
|
||||||
# Mengatur port
|
# Set port
|
||||||
ENV PORT 3000
|
ENV PORT 3000
|
||||||
|
|
||||||
# RUN npm install --force
|
# Set working directory
|
||||||
# RUN npm install --force
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
# Membuat direktori aplikasi dan mengatur sebagai working directory
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Menyalin file penting terlebih dahulu untuk caching
|
# Copy package.json dan package-lock.json (kalau ada)
|
||||||
COPY package.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
# Menyalin direktori ckeditor5 jika diperlukan
|
# Copy vendor ckeditor (jika memang perlu sebelum install)
|
||||||
COPY vendor/ckeditor5 ./vendor/ckeditor5
|
COPY vendor/ckeditor5 ./vendor/ckeditor5
|
||||||
|
|
||||||
# Menyalin env
|
|
||||||
# COPY .env .env
|
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN npm install
|
RUN npm install
|
||||||
# RUN pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
# Menyalin source code aplikasi
|
# Copy semua source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build aplikasi
|
# Build aplikasi
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
# RUN NODE_OPTIONS="--max-old-space-size=4096" pnpm next build
|
|
||||||
|
|
||||||
# Expose port untuk server
|
# Expose port
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
# Perintah untuk menjalankan aplikasi
|
# Jalankan aplikasi
|
||||||
CMD ["npm" "run" "start"]
|
CMD ["npm", "run", "start"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue