Docker ?
, and,
Solutions
Recommended
# Dockerfile Examples FROM node:18 AS builder WORKDIR /app COPY package*.json./ RUN npm ci COPY. RUN npm run build # FROM node:18-alpine AS production WORKDIR /app COPY --from=builder /app/dist./dist COPY --from=builder /app/node_modules./node_modules CMD ["node", "dist/main.js"]
and., and.
: / (Go, Java, TypeScript and more)
Recommended
# Comparisons: # node:18 ~900MB # node:18-slim ~200MB # node:18-alpine ~170MB # alpine FROM node:18-alpine # distroless() FROM gcr.io/distroless/nodejs18-debian12
alpine musl libc,. distroless shell and,.
:,
Dockerfile and
# RUN command RUN apt-get update && \ apt-get install -y --no-install-recommends curl && \ rm -rf /var/lib/apt/lists/* # RUN npm ci --only=production #.dockerignore #.dockerignore : # node_modules #.git # *.md # tests/
RUN, command.,.dockerignore.
: alpine
alpine musl libc,
distroless shell, exec
COPY --from