79741188

Date: 2025-08-20 14:27:58
Score: 0.5
Natty:
Report link
# stage deps
FROM node:18.17.0 AS deps

WORKDIR /usr/src/app

COPY package*.json yarn.lock ./
RUN yarn install # Install both production and development dependencies

# stage builder
FROM node:18.17.0 AS builder
COPY --from=deps ./
COPY . .

RUN yarn build

RUN yarn install --production

# Production image
FROM node:18.17.0-alpine

WORKDIR /usr/src/app


COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/node_modules ./dist/node_modules

# Prune development dependencies


CMD ["node", "dist/main"]
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: tandev