Files
no-copy-frontend/Dockerfile
T
2025-12-04 14:10:36 +07:00

23 lines
621 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 npm run build
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"]