# syntax=docker/dockerfile:1 FROM docker.ibagher.ir/node:22-bullseye-slim AS builder WORKDIR /app # Increase memory for large builds ENV NODE_OPTIONS="--max-old-space-size=4096" ENV NEXT_TELEMETRY_DISABLED=1 COPY package.json yarn.lock ./ RUN --mount=type=cache,target=/usr/local/share/.cache/yarn \ yarn install COPY . . RUN --mount=type=cache,target=/app/.next/cache \ yarn build FROM docker.ibagher.ir/node:22-bullseye-slim AS runner WORKDIR /app ENV NODE_ENV=production # Copy standalone output COPY --from=builder /app/.next/standalone ./ COPY --from=builder /app/.next/static ./.next/static COPY --from=builder /app/public ./public EXPOSE 3000 CMD ["node", "server.js"]