# PHASE 1: copy and build FROM node:22-alpine AS build ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_PRIVATE_STANDALONE true WORKDIR /app COPY . . RUN rm -rf node_modules && npm i --package-lock-only && npm ci RUN npm run build # PHASE 2: prepare for exec FROM node:22-alpine AS exec ENV NEXT_TELEMETRY_DISABLED 1 ENV NODE_ENV production WORKDIR /app COPY --from=build /app/.next/standalone . COPY --from=build /app/.next/static ./.next/static COPY --from=build /app/public ./public EXPOSE 3000 ENTRYPOINT [ "node" ] CMD ["server.js"]