Install this skill: copy and save to ~/.claude/skills/docker-setup/SKILL.md

Docker Setup

Creates Dockerfile and docker-compose.yml optimized for the project's stack with multi-stage builds and dev/prod configs.

5 min|Intermediate
LaunchDeep WorkDeveloper
SKILL.md~/.claude/skills/docker-setup/
---
name: docker-setup
description: |
  Creates Docker configuration files optimized for the project's stack.
  IMPORTANT: Activate this skill whenever the user asks to "dockerize",
  "add Docker", "create Dockerfile", or "containerize".
  This skill MUST be used for all Docker setup requests.
---

# Docker Setup

Creates a production-ready Dockerfile and docker-compose.yml tailored to your project's tech stack. Includes multi-stage builds, proper layer caching, and separate dev/prod configurations.

**Trigger:**

Say any of these to activate this skill:
- "dockerize this project"
- "add Docker"
- "create a Dockerfile"
- "Use skill: docker setup"

**How It Works:**

1. Read package.json (or equivalent) to identify the runtime and framework
2. Detect the package manager (npm, yarn, pnpm, bun) for correct install commands
3. Check for a database and other services that need docker-compose entries
4. Create a multi-stage Dockerfile: deps stage, build stage, production stage
5. Optimize layer caching: copy lock file first, install deps, then copy source
6. Create docker-compose.yml with the app, database, and any other services
7. Add .dockerignore to exclude node_modules, .git, and other unnecessary files
8. Include both dev and prod configurations (docker-compose.dev.yml override)

**Guidelines:**

- Use specific base image versions, never `node:latest`
- Copy only necessary files to the production stage (no dev dependencies, no source maps)
- Set proper user permissions (don't run as root)
- Include health checks for all services
- Expose only the ports that need to be accessible

**Works With:**

- Best with: Claude Code CLI (can create all files and test with docker build)
- Also works: Cursor, Windsurf
- Expects: Any project that needs containerization

**Output Format:**

- Dockerfile with multi-stage build
- docker-compose.yml with all required services
- .dockerignore file
- docker-compose.dev.yml for local development

Creates a production-ready Dockerfile and docker-compose.yml tailored to your project's tech stack. Includes multi-stage builds, proper layer caching, and separate dev/prod configurations.

Say any of these to activate this skill: - "dockerize this project" - "add Docker" - "create a Dockerfile" - "Use skill: docker setup"

1. Read package.json (or equivalent) to identify the runtime and framework 2. Detect the package manager (npm, yarn, pnpm, bun) for correct install commands 3. Check for a database and other services that need docker-compose entries 4. Create a multi-stage Dockerfile: deps stage, build stage, production stage 5. Optimize layer caching: copy lock file first, install deps, then copy source 6. Create docker-compose.yml with the app, database, and any other services 7. Add .dockerignore to exclude node_modules, .git, and other unnecessary files 8. Include both dev and prod configurations (docker-compose.dev.yml override)

  • Use specific base image versions, never node:latest
  • Copy only necessary files to the production stage (no dev dependencies, no source maps)
  • Set proper user permissions (don't run as root)
  • Include health checks for all services
  • Expose only the ports that need to be accessible
  • Best with: Claude Code CLI (can create all files and test with docker build)
  • Also works: Cursor, Windsurf
  • Expects: Any project that needs containerization
  • Dockerfile with multi-stage build
  • docker-compose.yml with all required services
  • .dockerignore file
  • docker-compose.dev.yml for local development