Files
2026-02-04 17:26:33 +07:00

23 lines
645 B
Docker

FROM node:22.20.0 AS dependencies
WORKDIR /no-copy-frontend
COPY package.json package-lock.json ./
RUN npm install
FROM node:22.20.0 AS builder
WORKDIR /no-copy-frontend
COPY . .
COPY --from=dependencies /no-copy-frontend/node_modules ./node_modules
RUN rm -rf .next && npm run build --force
FROM node:22.20.0 AS runner
WORKDIR /no-copy-frontend
ENV NODE_ENV=production
COPY --from=builder /no-copy-frontend/public ./public
COPY --from=builder /no-copy-frontend/package.json ./package.json
COPY --from=builder /no-copy-frontend/.next ./.next
COPY --from=builder /no-copy-frontend/node_modules ./node_modules
EXPOSE 2999
CMD ["npm", "start"]