update
This commit is contained in:
parent
1a9756db9b
commit
c66427544f
44
Dockerfile
44
Dockerfile
|
|
@ -1,36 +1,24 @@
|
|||
# Menggunakan image Node.js yang lebih ringan
|
||||
FROM node:23.5.0-alpine
|
||||
FROM node:21-alpine
|
||||
|
||||
# Mengatur port
|
||||
ENV PORT 3000
|
||||
ENV PORT 4000
|
||||
|
||||
# Install pnpm secara global
|
||||
RUN npm install -g pnpm
|
||||
|
||||
# Membuat direktori aplikasi dan mengatur sebagai working directory
|
||||
# Create app directory
|
||||
RUN mkdir -p /usr/src/app
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Menyalin file penting terlebih dahulu untuk caching
|
||||
COPY package.json ./
|
||||
# Installing dependencies
|
||||
COPY package*.json /usr/src/app/
|
||||
|
||||
# Menyalin direktori ckeditor5 jika diperlukan
|
||||
COPY vendor/ckeditor5 ./vendor/ckeditor5
|
||||
# RUN npm install --force
|
||||
RUN npm install --legacy-peer-deps
|
||||
RUN npm install
|
||||
|
||||
# Menyalin env
|
||||
COPY .env .env
|
||||
# Copying source files
|
||||
COPY . /usr/src/app
|
||||
|
||||
# Install dependencies
|
||||
RUN pnpm install
|
||||
# RUN pnpm install --frozen-lockfile
|
||||
# Building app
|
||||
RUN npm run build
|
||||
EXPOSE 4000
|
||||
|
||||
# Menyalin source code aplikasi
|
||||
COPY . .
|
||||
|
||||
# Build aplikasi
|
||||
RUN NODE_OPTIONS="--max-old-space-size=4096" pnpm next build
|
||||
|
||||
# Expose port untuk server
|
||||
EXPOSE 3000
|
||||
|
||||
# Perintah untuk menjalankan aplikasi
|
||||
CMD ["pnpm", "run", "start"]
|
||||
# Running the app
|
||||
CMD "npm" "run" "start"
|
||||
|
|
|
|||
Loading…
Reference in New Issue