containerize-service
Skill7 starsChanged 16 days agoMITView on GitHub
Use when a backend or full-stack service needs a production container image — multi-stage Dockerfile per track (Node/pnpm, Go, Python/uv), non-root, digest-pinned bases, health check, SBOM and provenance, image scan.
- Reads credentials
3 other projects use a version of this.
Adopted by
Most recently taken up by
- Indium-AI-Labs/indium-agentkittheir own version, first seen Nov 1, 2026
- Ionate-Technologies/indium-agentkittheir own version, first seen Oct 20, 2026
- VelimirMueller/claude-skillsword for word, first seen Oct 11, 2026
Other versions3 projects use a version of this.
Word for word · 1
- VelimirMueller/claude-skills★ 7100% same
Edited · 0
None found.
Wrote their own version · 2
- Indium-AI-Labs/indium-agentkit★ 18same name
- Ionate-Technologies/indium-agentkit★ 17same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository156 other files it gives its agents.
- skills/swift/swiftui-design-principles/AGENTS.mdAGENTS.md
- skills/swift/ios-code-audit/CLAUDE.mdCLAUDE.md
- skills/swift/swift-focusengine-pro/llms.txtllms.txt
- build-llm-seamSkill
- build-mcp-serverSkill
- build-rag-pipelineSkill
- secure-llm-featuresSkill
- set-up-llm-evalsSkill
- build-nextjs-backendSkill
- build-supabase-edge-functionSkill
- configure-backend-testsSkill
- design-http-apiSkill
- harden-backendSkill
- scaffold-fastapi-serviceSkill
- scaffold-go-serviceSkill
- scaffold-hono-serviceSkill
- secure-supabase-rlsSkill
- set-up-backend-authSkill
- set-up-background-jobsSkill
- set-up-databaseSkill
- set-up-nextjs-supabase-authSkill
- set-up-observabilitySkill
- set-up-supabaseSkill
- build-cliSkill
- release-cliSkill
- set-up-dev-toolchainSkill
- audit-securitySkill
- audit-toolchainSkill
- extend-skillsetSkill
- promote-releaseSkill
- set-up-stack-profileSkill
- write-commit-messagesSkill
- write-pull-requestsSkill
- analyze-complexitySkill
- apply-algorithmsSkill
- apply-design-patternsSkill
- apply-design-principlesSkill
- apply-solidSkill
- choose-data-structureSkill
- debug-systematicallySkill
- enforce-dependency-ruleSkill
- refactor-safelySkill
- slice-and-estimateSkill
- write-clean-testsSkill
- write-readable-codeSkill
- clean-frontend-scaffoldingSkill
- configure-accessibilitySkill
- configure-analyticsSkill
- configure-ciSkill
- configure-error-trackingSkill
- configure-lintingSkill
- configure-test-stackSkill
- configure-typescriptSkill
- create-moduleSkill
- optimize-performanceSkill
- scaffold-frontend-projectSkill
- set-up-authSkill
- set-up-design-systemSkill
- set-up-document-headSkill
- set-up-error-boundariesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
All checks pass and trivy is clean → say "already in place" and stop.
≈ “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.
Files
Containerize Service
One image per service, built once, run as a non-root user, healthy only when the service says so. The same image goes to dev, stg and prd (environments.md).
1. Audit current state (change nothing)
cat .claude/stack-profile.md 2>/dev/null # languages, package_manager, backend.track, hosting
ls Dockerfile* .dockerignore compose*.y*ml deploy/ 2>/dev/null
ls pnpm-lock.yaml go.mod pyproject.toml uv.lock 2>/dev/null # which track(s)
grep -rn "healthz\|/health" --include=*.ts --include=*.go --include=*.py . 2>/dev/null | grep -v node_modules | head -3
docker --version && docker buildx versionRead from the profile: languages, package_manager (pnpm, go, uv), backend.track (hono, nextjs, go, fastapi), hosting. If there is no profile, detect from the lockfiles above. Ask one question only when two tracks match (a monorepo) and the choice changes the output: which service to containerize. Suggest set-up-stack-profile if the profile is missing.
2. Decide
- No
Dockerfile→ full (steps 3 to 7). Dockerfileexists → delta: check each line of the checklist below, fix only what fails.- All checks pass and
trivyis clean → say "already in place" and stop.
Checklist: multi-stage; every FROM has @sha256:; final stage non-root; .dockerignore excludes .git, node_modules, .env*; HEALTHCHECK present; no secret in ENV, ARG or COPY; --frozen-lockfile, --locked or go mod download before source copy.
3. Detect the track
| Evidence | Track | Template in dockerfile-patterns.md |
package.json + pnpm-lock.yaml (Hono, Fastify, Nest) | Node/pnpm | "Node (pnpm)" |
package.json with next | Node/pnpm, Next.js | "Node (pnpm)" plus the standalone note |
go.mod | Go static | "Go" |
pyproject.toml + uv.lock (FastAPI) | Python/uv | "Python (uv)" |
npm/yarn/bun lockfile | same shape; swap the install line | keep the stage layout |
Hosted on Vercel (hosting: [vercel]) and no worker or long-running process: no image needed. Stop and say so; use deploy-to-vercel.
4. Install only what is missing
Nothing on the host except Docker with BuildKit (docker buildx version). Do not install language toolchains for the image; the build stage carries them. Create .dockerignore first:
.git
node_modules
dist
.venv
__pycache__
bin
*.test
.env*
!.env.example
Dockerfile
.dockerignore5. Generate the seams
- Health seam. The service exposes
GET /healthzreturning 200 when it can serve. The image probes it with the service's own binary, because distroless has nocurlor shell. Code for each track is in dockerfile-patterns.md. - Dockerfile from the track template. Set the three
ARG … IMAGE=lines to the digests in stack-versions.md; re-read the digest withdocker buildx imagetools inspect <image:tag> --format '{{.Manifest.Digest}}'. - Graceful shutdown. The process handles
SIGTERMand finishes in-flight requests within 10 s. Compose and Kubernetes sendSIGTERMfirst.
6. Wire
- Build locally with attestations and check them:
Attestations needdocker buildx build --sbom=true --provenance=mode=max -t localhost:5005/app:test --push .--push, or the containerd image store, or adocker-containerbuilder. In CI the pipeline builds withprovenance: falseand signs once withactions/attest; see set-up-delivery-pipeline. Do not add a second build path here. - Scan with Trivy from a pinned image, not the GitHub Action (its tags were rewritten in March 2026):
Grype (docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v trivy-cache:/root/.cache \ ghcr.io/aquasecurity/trivy:0.75.0@sha256:af6acf9a6b85dfe389a1941505c0ce9efef52a4719635e1a962f022a3d855daa \ image --exit-code 1 --severity HIGH,CRITICAL --ignore-unfixed --no-progress app:testanchore/grype) is an equal choice if you already use Syft SBOMs. - Probes. Compose uses the image
HEALTHCHECK. Kubernetes ignores it; definereadinessProbeandlivenessProbeagainst/healthz. - Compose and the host: deploy-to-hetzner, deploy-to-ionos.
7. Verify
docker build -t app:test . && docker image inspect app:test --format '{{.Config.User}}'Expect a non-root user (65532, nonroot or 10001:10001), never empty or 0.
docker run -d --name app-test -p 3000:3000 app:test && sleep 12 && curl -fsS localhost:3000/healthz
docker inspect app-test --format '{{.State.Health.Status}}' # healthy
docker rm -f app-testExpect ok and healthy. Reproducibility check (same digest twice):
for i in 1 2; do docker buildx build --no-cache --provenance=false --sbom=false \
--build-arg SOURCE_DATE_EPOCH=1760000000 --output type=oci,dest=/tmp/r$i.tar,rewrite-timestamp=true . ; done
for i in 1 2; do tar -xOf /tmp/r$i.tar index.json | grep -o 'sha256:[a-f0-9]*' | head -1; doneExpect two identical digests. Trivy exits 0.
References
- container-patterns.md: the rules and why (base image, user, pinning, health, SBOM, scanning, secrets).
- dockerfile-patterns.md: the three templates, built and run during authoring.
- ../_shared/environments.md: build once, promote the digest.
- ../../core/_shared/security-baseline.md, ../../core/_shared/engineering-principles.md.
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
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.

