Loading...
Loading...
Docker and Docker Compose optimization. Multi-stage builds, security, debugging.
npx skill4agent add navanithans/agent-skill-kit ask-docker-expertUSER nodenode:18-alpine3.18# Build Stage
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Production Stage
FROM node:18-alpine
WORKDIR /app
COPY /app/dist ./dist
COPY /app/package.json ./
RUN npm install --production
USER node
CMD ["npm", "start"]