FROM node:20-alpine AS build WORKDIR /home/node/app COPY package*.json ./ COPY tsconfig.json ./ COPY lib ./lib RUN ls -a RUN yarn install RUN yarn build ## this is stage two , where the app actually runs FROM node:20-alpine AS containerize ENV NODE_ENV ${ENV:-production} WORKDIR /home/node/app COPY package*.json ./ RUN yarn install --frozen-lockfile --production COPY --from=0 /home/node/app/dist/**/*.js . EXPOSE ${PORT} CMD ["node","server/index.js"]