FROM node:18-alpine AS build # Install dependencies only when needed # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. RUN apk add --no-cache libc6-compat RUN mkdir /app COPY package.json /app WORKDIR /app COPY . . RUN yarn RUN yarn build EXPOSE 3000 # Run the next build process and generate the artifacts CMD ["yarn", "start"]