agentleFS
milad-ahmdmilad-ahmd/agent-skills/skills/dockerize-anything/SKILL.md

dockerize-anything

Skill5 starsChanged 15 days agoMITView on GitHub

Generates a production-ready, secure, small Dockerfile, .dockerignore and docker-compose.yml for any project by detecting its stack, then builds and verifies the image. Use when the user asks to dockerize, containerize, add Docker or compose, or reduce Docker image size.

  • Reads credentials
  • Installs packages

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No secrets in the image. Pass them as runtime env or BuildKit secrets.

    line 24

≈ “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

Dockerize Anything

Production-grade containers, not "FROM node, COPY . ., npm start".

1. Detect

  • Language, version (.nvmrc, engines, .python-version, go.mod, rust-toolchain), and package manager plus lockfile.
  • Build command, start command, port, and the env vars the app reads (search for process.env, os.environ, os.Getenv...).
  • Services it depends on (Postgres, Redis, Mongo...) from config and dependencies.
  • Whether a Dockerfile already exists. If so, improve it instead of replacing it.

2. Dockerfile rules

  • Multi-stage: a deps → build → runtime chain. Only runtime artifacts end up in the final stage.
  • Pinned, slim base images: node:<ver>-alpine or -slim, python:<ver>-slim, and gcr.io/distroless/static for Go and Rust static binaries.
  • Layer caching: copy the lockfiles first, install dependencies, then copy the source.
  • Install production dependencies only (npm ci --omit=dev, pip install --no-cache-dir, CGO_ENABLED=0).
  • Non-root user, EXPOSE <port>, HEALTHCHECK when there's an HTTP endpoint, and exec-form CMD.
  • No secrets in the image. Pass them as runtime env or BuildKit secrets.

3. Also generate

  • .dockerignore: .git, node_modules, .venv, build output, .env*, logs, tests, and docs if they aren't needed.
  • docker-compose.yml: the app plus the detected services, with named volumes, healthcheck, depends_on: condition: service_healthy and env_file: .env.
  • .env.example entries for each variable the app requires.

4. Verify (if Docker is available)

docker build -t <app>:local .
docker images <app>:local --format '{{.Size}}'
docker compose up -d && docker compose ps && docker compose logs --tail=50 app

Fix any failures, then report the final image size and how to run it. Run docker compose down when you're done.

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.