DockerPlay
1

Interactive Dockerfile Studio & Layer Cache Builder

Total Image Layers6 Layers
Final Compressed Size82 MB
Multi-Stage Slim Savings93% Smaller (1140MB ➔ 82MB)
DockerfileRead-only template
# Stage 1: Build Dependencies
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production

# Stage 2: Production Minimal Runtime
FROM node:22-alpine
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/node_modules ./node_modules
COPY . .
EXPOSE 3000
USER node
CMD ["node", "server.js"]
Simulate Developer Code Change:
Layer Assembly & Cache StatusBase ➔ Top Layer
1FROM node:22-alpine

Minimal Alpine-based distribution (~5MB core OS + Node runtime).

REBUILD52 MB
2WORKDIR /app

Creates and sets execution context to /app.

REBUILD0 MB (Metadata)
3COPY package*.json ./

Copied separately to leverage layer cache when source code changes.

REBUILD0.1 MB
4RUN npm ci --only=production

Deterministic install of only runtime packages.

REBUILD24 MB
5COPY . .

Fast layer rebuilt only when application code changes.

REBUILD5.9 MB
6USER node & CMD

Runs as non-root user for enterprise container security.

REBUILD0 MB (Metadata)
Docker Terminal
Quick:
$docker version8:41:44 PM
Client: Docker Engine - Community v27.1.1
Server: Docker Engine - Simulated In-Browser Runtime (Safe Sandbox)
Storage Driver: overlay2 (Virtual Layers)
Status: Ready • Zero Docker Desktop Required
$