Files
webapp-conversation/Dockerfile
yuzhiheng dc1659463e feat(docker): Docker build with multi-stage
This will significantly reduce the size of the final image used for deployment.
2025-09-04 15:11:13 +08:00

18 lines
431 B
Docker

FROM node:22-alpine AS deps
WORKDIR /app
COPY . .
RUN yarn install --frozen-lockfile
FROM deps AS builder
WORKDIR /app
COPY . .
RUN yarn build
FROM node:22-alpine AS runner
WORKDIR /app
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
EXPOSE 3000
CMD ["node", "server.js"]