diff --git a/Dockerfile b/Dockerfile index 076d551..948bd41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,25 @@ FROM node:21-alpine -ENV PORT 4000 +ENV PORT=4000 -# Create app directory -RUN mkdir -p /usr/src/app WORKDIR /usr/src/app -# Installing dependencies -COPY package*.json /usr/src/app/ +# Install git (WAJIB untuk next build) +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 -# Copying source files -COPY . /usr/src/app +# Copy source +COPY . . -# Building app +# Build app RUN npm run build + EXPOSE 4000 -# Running the app -CMD "npm" "run" "start" +# Run app +CMD ["npm", "run", "start"]