container-compose-ghcr-deployment
Skill0 starsChanged 3 months agoMITView on GitHub
Use when creating, reviewing, debugging, or hardening Dockerfiles, Docker Compose configuration, container build pipelines, GitHub Container Registry publishing, runtime environment separation, image health checks, or container deployment workflows.
- Reads credentials
In this repository9 other files it gives its agents.
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. About 0 are common, 22 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈22
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Do not activate merely because an application needs deployment.
- Very specific: line 19
Never copy .env, credentials, registry tokens, private keys, local databases, or repository metadata into an image.
- Distinctive: line 20
Keep build-time and runtime configuration distinct.
- Distinctive: line 21
Do not invent a GHCR owner/image name, secret name, deployment host, port, health endpoint, or production command.
- Distinctive: line 23
Prefer non-root runtime users when the application and base image support it.
- Distinctive: line 24
Use immutable image references/digests for production promotion when the deployment system supports them.
- Distinctive: line 25
Never hide failed builds, tests, or health checks.
- Distinctive: line 43
Use the static preflight scanner for a quick map:
- Distinctive: line 55
Do not bundle databases/caches into the application image.
- Distinctive: line 65
Do not copy the entire repository into the final stage by habit.
- Very specific: line 69
Create or update .dockerignore to exclude at least applicable examples such as:
- Distinctive: line 75
test artifacts and coverage unless required by the build.
- Distinctive: line 78
Never assume a generic ignore list is complete.
- Distinctive: line 82
When Compose is requested:
- Distinctive: line 85
avoid baking production-only assumptions into local developer commands.
- Distinctive: line 86
use named services, networks, volumes, and dependency health conditions only where they add value.
- Distinctive: line 89
document required variables by name, not secret value.
- Distinctive: line 97
use repository permissions required for checkout and package publishing, no broader.
- Very specific: line 101
keep latest optional rather than the only deployable reference.
- Distinctive: line 103
use caching only when it does not compromise correctness.
- Distinctive: line 105
Do not fabricate production deployment steps after the image push unless the repository contains a deployment target and credentials …
- Distinctive: line 119
run the application with safe non-secret configuration.
- Distinctive: line 122
verify final image user, entrypoint, and expected files.
- Distinctive: line 123
run CI-equivalent checks before publication.
- Distinctive: line 125
If the current environment lacks a container engine, say so and limit claims to static validation.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
Container, Compose, and GHCR Deployment
Design container delivery that fits the repository instead of forcing the repository to fit containers.
Use when
Activate when the task explicitly involves Docker/container images, Compose, GHCR, image CI, container runtime configuration, health checks, build contexts, multi-stage builds, or deployment from published images.
Do not activate merely because an application needs deployment. Do not require developers to run Docker locally if the project already has a different supported local workflow.
Safety rules
- Inspect the existing runtime, package manager, build command, ports, environment files, and CI before writing container files.
- Never copy
.env, credentials, registry tokens, private keys, local databases, or repository metadata into an image. - Keep build-time and runtime configuration distinct.
- Do not invent a GHCR owner/image name, secret name, deployment host, port, health endpoint, or production command.
- Pin important runtime/toolchain versions consistently with the repository's declared version policy.
- Prefer non-root runtime users when the application and base image support it.
- Use immutable image references/digests for production promotion when the deployment system supports them.
- Never hide failed builds, tests, or health checks.
Workflow
1. Discover the repository contract
Inspect:
- runtime/version files and package/project manifests;
- package manager lockfiles;
- build and start scripts;
- framework output mode and generated artifacts;
- ports and health/readiness behavior;
- existing Dockerfile/Compose files;
.dockerignoreand.gitignore;- CI workflows and registry conventions;
- environment examples/documentation, without copying real secrets.
Use the static preflight scanner for a quick map:
python scripts/container_preflight.py <project-root> --jsonIt does not build containers unless the agent explicitly chooses a separate runtime validation step.
2. Decide what is being containerized
Identify the deployment unit: web app, API, worker, scheduled process, static output, or multiple services. A Dockerfile should have one clear runtime responsibility; Compose may orchestrate several units.
Do not bundle databases/caches into the application image. In Compose, model them as separate services only when the requested environment needs them.
3. Build a minimal image
For compiled/bundled applications, prefer a multi-stage build when it materially reduces runtime dependencies or image size:
- dependency/install stage using the repository's real lockfile and package manager;
- build stage with only required build-time configuration;
- runtime stage containing only runtime artifacts and dependencies.
Do not copy the entire repository into the final stage by habit. Do not install development dependencies in the runtime image unless they are required at runtime.
4. Harden build context
Create or update .dockerignore to exclude at least applicable examples such as:
- VCS metadata;
- local dependencies/caches/build outputs that are rebuilt in-image;
.env*except intentionally safe example files when needed;- editor/system files;
- test artifacts and coverage unless required by the build;
- local archives/backups.
Never assume a generic ignore list is complete; inspect the actual repository.
5. Compose without environment confusion
When Compose is requested:
- distinguish development Compose from deployment Compose if their concerns differ;
- avoid baking production-only assumptions into local developer commands;
- use named services, networks, volumes, and dependency health conditions only where they add value;
- preserve user data volumes deliberately;
- expose ports only when external access is required;
- document required variables by name, not secret value.
A health check should verify the service's real readiness contract. Do not invent /health if it does not exist.
6. Publish to GHCR safely
For GitHub Actions publishing:
- use repository permissions required for checkout and package publishing, no broader;
- authenticate to GHCR with the workflow-provided token when sufficient, or an explicitly documented secret when not;
- derive image naming from repository/org context or existing conventions;
- build deterministic tags for branch/commit/release needs;
- keep
latestoptional rather than the only deployable reference; - build before push and surface failures;
- use caching only when it does not compromise correctness.
Do not fabricate production deployment steps after the image push unless the repository contains a deployment target and credentials contract.
7. Validate in layers
Static validation:
python scripts/container_preflight.py <project-root>Then use available project/container tooling, for example only when actually present and appropriate:
- parse/validate Compose config;
- build the image from a clean context;
- run the application with safe non-secret configuration;
- inspect health/readiness;
- exercise the documented port/endpoint;
- verify final image user, entrypoint, and expected files;
- run CI-equivalent checks before publication.
If the current environment lacks a container engine, say so and limit claims to static validation.
Common failure modes
- Copying
.envinto the image because it makes local testing easier. - Using a production image as a substitute for a normal local workflow.
- Running a development server inside the production container.
- Mixing build-time public variables and runtime secrets.
- Depending on
depends_onas if it proved another service is ready. - Publishing only a mutable
latesttag. - Giving GHCR package write permissions to unrelated jobs.
- Claiming the image works after validating YAML only.
- Destructive database initialization in an entrypoint without explicit migration policy.
Output
Report the detected application/runtime contract, files changed, image/runtime stages, environment-variable expectations, registry/tag strategy, validations actually run, and anything that still requires a real container engine or deployment environment.
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.

