This commit is contained in:
Anang Yusman 2025-12-30 17:09:25 +08:00
parent 163c0c5a9c
commit ae5f61d307
1 changed files with 13 additions and 12 deletions

View File

@ -1,24 +1,25 @@
FROM node:21-alpine FROM node:21-alpine
ENV PORT 4000 ENV PORT=4000
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app WORKDIR /usr/src/app
# Installing dependencies # Install git (WAJIB untuk next build)
COPY package*.json /usr/src/app/ RUN apk add --no-cache git
# RUN npm install --force # Copy package files
COPY package*.json ./
# Install dependencies (cukup SEKALI)
RUN npm install --legacy-peer-deps RUN npm install --legacy-peer-deps
RUN npm install
# Copying source files # Copy source
COPY . /usr/src/app COPY . .
# Building app # Build app
RUN npm run build RUN npm run build
EXPOSE 4000 EXPOSE 4000
# Running the app # Run app
CMD "npm" "run" "start" CMD ["npm", "run", "start"]