FROM docker.io/node:19.5.0-alpine AS base WORKDIR /app COPY package.json package-lock.json ./ FROM base AS builder # install dependencies RUN npm ci # Copy all local files into the image. COPY . . RUN npm run build ### # Only copy over the Node pieces we need # ~> Saves 35MB ### FROM base COPY --from=builder /app/build . COPY ./server.js . RUN npm ci --omit dev ENV HOST=0.0.0.0 EXPOSE 3000 CMD ["node", "server.js"]