🐳 dockerize-anything
Production-ready, small, secure Dockerfile and compose for any repo. A free, open-source Agent Skill for Claude Code, Cline, Cursor, Codex and 75+ AI agents.
Install dockerize-anything
# Claude Code (all 51 skills)
/plugin install all-skills --marketplace milad-ahmd/agent-skills
# Cursor, Codex, Cline, Windsurf, Copilot + 75 more agents
npx skills add milad-ahmd/agent-skills --skill dockerize-anything
# Shell installer
curl -fsSL https://raw.githubusercontent.com/milad-ahmd/agent-skills/main/install.sh | bash -s -- dockerize-anythingIncluded in packs: startup-cto-pack, developer-pack
What to say to your agent
Dockerize this projectMake my Docker image smaller
When it triggers
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.
Full skill instructions (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→runtimechain. Only runtime artifacts end up in the final stage. - Pinned, slim base images:
node:<ver>-alpineor-slim,python:<ver>-slim, andgcr.io/distroless/staticfor 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>,HEALTHCHECKwhen there's an HTTP endpoint, and exec-formCMD. - 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_healthyandenv_file: .env..env.exampleentries 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.
View source on GitHub ⭐ Star the collection