feat: update dockerfile and change runtime to pnpm

This commit is contained in:
hanif salafi 2024-12-25 00:14:27 +07:00
parent 5069332589
commit 35c07fcaef
2 changed files with 10766 additions and 6 deletions

View File

@ -2,23 +2,25 @@ FROM node:23.5.0-alpine
ENV PORT 3000 ENV PORT 3000
# Install pnpm globally
RUN npm install -g pnpm
# Create app directory # Create app directory
RUN mkdir -p /usr/src/app RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app WORKDIR /usr/src/app
# Installing dependencies # Installing dependencies
COPY package*.json /usr/src/app/ COPY package*.json pnpm-lock.yaml* /usr/src/app/
# RUN npm install --force # Install dependencies using pnpm
RUN npm install -g npm@11.0.0 RUN pnpm install --frozen-lockfile
RUN npm install next --legacy-peer-deps
# Copying source files # Copying source files
COPY . /usr/src/app COPY . /usr/src/app
# Building app # Building app
RUN npm run build RUN pnpm run build
EXPOSE 3000 EXPOSE 3000
# Running the app # Running the app
CMD "npm" "run" "start" CMD ["pnpm", "run", "start"]

10758
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff