Docker build

From berkcangumusisik/claude-code-practices · View interactive version

Docker build is an AI agent skill from the GitHub repository berkcangumusisik/claude-code-practices. Creates or optimizes a Dockerfile for the current project

How to use this skill

Skill file

Docker Setup

  1. Detect project type:
cat package.json 2>/dev/null | grep '"main"\|"start"\|"scripts"' -A 5
ls -la | grep -E "Dockerfile|docker-compose|\.dockerignore"
  1. If Dockerfile exists, review it for:
  1. If no Dockerfile, generate one following best practices:
# Multi-stage: build → runtime
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production

FROM node:20-alpine AS runtime
RUN addgroup -S app && adduser -S app -G app
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY . .
USER app
EXPOSE 3000
CMD ["node", "dist/index.js"]
  1. Also create/update .dockerignore:
node_modules
dist
.env*
.git
coverage
*.test.*
  1. Show docker build and docker run commands to test.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.