agentleFS
viknesh20-20viknesh20-20/claude-code-tool-kit/.claude/skills/docker-setup/SKILL.md

docker-setup

Skill7 starsChanged 6 months agoMITView on GitHub

Generates Dockerfile, docker-compose.yml, and .dockerignore for the project. Auto-detects the stack and creates optimized multi-stage builds with caching, health checks, and dev/prod configurations.

  • Reads credentials

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use specific image tags, not latest

    line 49
  2. Very specific:

    Use .dockerignore to minimize context

    line 50
  3. Distinctive:

    Run as non-root user

    line 52
  4. Distinctive:

    Use multi-stage builds to minimize final image size

    line 54
  5. Distinctive:

    Use ENTRYPOINT + CMD pattern

    line 56
  6. Distinctive:

    Never hardcode secrets in Dockerfile or docker-compose

    line 101
  7. Distinctive:

    Always use non-root user in production images

    line 102
  8. Distinctive:

    Always include health checks

    line 103

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Docker Setup Generator

Detect Stack

!ls package.json requirements.txt pyproject.toml go.mod Cargo.toml *.csproj Gemfile composer.json mix.exs 2>/dev/null !ls Dockerfile docker-compose* .dockerignore 2>/dev/null !cat package.json 2>/dev/null | grep -E '"(main|scripts)"' -A 5 | head -10


Generation Process

Step 1: Analyze Requirements

From project files, determine:

  • Base image (node:20-alpine, python:3.12-slim, golang:1.22, rust:1.75, etc.)
  • Build steps (install deps, compile, bundle)
  • Runtime dependencies (only what's needed to run, not to build)
  • Port(s) the application listens on
  • Required services (database, cache, message queue)
  • Environment variables needed

Step 2: Generate Dockerfile

Multi-stage build pattern:

# Stage 1: Dependencies
FROM base AS deps
COPY lock-file .
RUN install-command

# Stage 2: Build
FROM deps AS build
COPY source .
RUN build-command

# Stage 3: Production
FROM base-slim AS production
COPY --from=build /app/dist ./dist
CMD ["start-command"]

Best practices to include:

  • Use specific image tags, not latest
  • Use .dockerignore to minimize context
  • Copy lock files before source (layer caching)
  • Run as non-root user
  • Set HEALTHCHECK
  • Use multi-stage builds to minimize final image size
  • Set appropriate EXPOSE port
  • Use ENTRYPOINT + CMD pattern

Step 3: Generate docker-compose.yml

services:
  app:
    build: .
    ports: ["3000:3000"]
    environment: ...
    depends_on: ...
    volumes: ...  # for dev: mount source code
    healthcheck: ...

  # Add required services
  db:  # if database detected
  redis:  # if cache detected

Include:

  • Development overrides (volume mounts, hot reload)
  • Named volumes for persistent data
  • Network configuration
  • Health checks for all services
  • Environment variable references (not hardcoded values)

Step 4: Generate .dockerignore

node_modules/
.git/
dist/
build/
*.log
.env
.env.*

Step 5: Document

Add comments explaining:

  • Why each stage exists
  • How to build: docker build -t app .
  • How to run: docker compose up
  • How to access: http://localhost:PORT
  • How to run tests in Docker

Rules

  • Never hardcode secrets in Dockerfile or docker-compose
  • Always use non-root user in production images
  • Always include health checks
  • Minimize image size (alpine/slim base, multi-stage)
  • Include .dockerignore to speed up builds

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.