agentleFS
YauhenBichelYauhenBichel/engineering-skills/skills/containers-and-deploy/SKILL.md

containers-and-deploy

Skill0 starsChanged 54 days agoApache-2.0View on GitHub

Packages and deploys services with containers. Use for Dockerfiles, compose, Kubernetes or a server deploy.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are 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.

  • 2

    Very specific

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

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

    Add health checks and shutdown handling.

    line 9
  2. Very specific:

    Write a rollback plan. Tag the current running image as stable.

    line 11

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Steps

  1. Build a small image. Use a multi-stage Dockerfile. Pin the base tag (e.g., python:3.12-slim@sha256:...). Copy only the files needed at run time. Set USER app before the final CMD.
  2. Inject config and secrets. Pass runtime config via ENV or --env-file. Store credentials in a secret store (e.g., docker secret, kubectl create secret, or AWS Secrets Manager). Never write keys to the image.
  3. Add health checks and shutdown handling. Define a HEALTHCHECK that calls the app's health endpoint (the image must contain the tool it uses, for example curl). Catch SIGTERM in the app, flush buffers, and close connections before exiting.
  4. Apply resource limits. Set deploy.resources.limits in docker-compose.yml or Kubernetes manifests. Cap CPU and memory. Add reservations to guarantee baseline capacity.
  5. Write a rollback plan. Tag the current running image as stable. Keep the previous two versions. If the new deployment fails health checks or spikes errors, revert the service to stable immediately.

Checklist

  • Base image tag is pinned and verified.
  • Container runs as a non-root user.
  • Secrets reference a secure store, not plaintext.
  • Health check endpoint exists and matches the Dockerfile directive.
  • Resource limits are defined for CPU and memory.
  • Rollback procedure is documented and executable.
  • Graceful shutdown handler is implemented and tested.

Output

  • Updated Dockerfile and deployment manifests (docker-compose.yml or Kubernetes YAML).
  • Rollback runbook with exact revert commands.
  • Environment variable template and secret injection instructions.

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.