docker-and-compose
Skill1 starsChanged 6 days agoMITView on GitHub
How the Dockerfile builds, tests and publishes the solution, how the runtime image runs (non-root, /app/data volume, HEALTHCHECK), and what docker-compose starts. Use when changing the Dockerfile, the compose file or how the app runs in a container.
- Sends data out
1 other project uses a version of this.
Adopted by
Most recently taken up by
- JameMy0001/antigravity-skills-hubtheir own version, first seen Oct 2, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- JameMy0001/antigravity-skills-hub★ 1same 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 repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-a-use-caseSkill
- api-conventionsSkill
- branches-and-pull-requestsSkill
- cancellationSkill
- ci-for-your-solutionSkill
- ci-pipelineSkill
- clean-architecture-layersSkill
- configuration-and-environmentsSkill
- coverageSkill
- csharp-house-styleSkill
- data-access-ef-coreSkill
- database-migrationsSkill
- docs-and-voiceSkill
- errors-and-exceptionsSkill
- expose-a-use-caseSkill
- family-syncSkill
- health-checksSkill
- integration-testsSkill
- json-serializationSkill
- mapping-with-mapperlySkill
- mcp-inspectorSkill
- mediatorSkill
- optional-token-authSkill
- packages-and-dependenciesSkill
- pagingSkill
- presentation-integration-testsSkill
- releasesSkill
- sample-dataSkill
- security-findingsSkill
- serilogSkill
- telemetrySkill
- template-authoringSkill
- test-designSkill
- time-providerSkill
- unit-testsSkill
- validationSkill
- writing-a-skillSkill
- xml-docs-and-openapiSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 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.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 45
Keep restore before COPY .
- Very specific: line 49
Test locally with docker compose up -d --build, then hit /health/ready and the API reference.
- Very specific: line 53
Run the runtime image as root, or write outside /app/data.
- Very specific: line 54
Use :latest for any image.
- Distinctive: line 55
Add a push step to a registry.
≈ “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
Docker and Compose
The rule
One multi-stage Dockerfile does everything the pipeline needs:
| Stage | Does |
build | Restores (the .slnx, the root build files and every project file copied first for layer caching), then builds in Release with the version passed in |
test | Runs every test project with coverage and saves the results and exit code |
results | Exports the test results so the pipeline can report them |
publish | Publishes the Presentation project |
run | The runtime image: non-root $APP_UID, WORKDIR /app, data in /app/data, a HEALTHCHECK on /health/live |
docker-compose.yml runs the app with DOTNET_ENVIRONMENT=docker, the movie-reviews-data volume a pinned OpenTelemetry Collector that receives the app's OTLP logs, traces and metrics, configured by otel-collector.yaml, and a pinned Aspire dashboard the collector forwards them to (telemetry). The dashboard UI and the collector's OTLP ports are published on the template's own ports (below), so a dotnet run can send to the collector too. The dashboard runs with ASPIRE_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS and the collector's OTLP ports take anything sent to them, on purpose: the compose file is for a developer's machine, with nothing to sign in to. Keep it that way rather than adding sign-in, and don't offer the compose file for a shared or deployed environment. Images are built by CI but not pushed anywhere; the template ships the Dockerfile so users can.
The Lambda template's run stage is the AWS Lambda .NET base image instead. It runs as user 65534 from /var/task, keeps its database in /tmp, and has no HEALTHCHECK. Its compose file runs the collector and the Aspire dashboard as well. Compose maps the runtime interface emulator to 7350, so the function can be invoked with a POST to /2015-03-31/functions/function/invocations.
Ports
Every port published on the developer's machine, by the compose file or by launchSettings.json, sits in the template's own block of ten, so any two Lean Mean Clean solutions run side by side. The blocks follow the template order: Minimal API 7310, MCP 7320, GraphQL 7330, Web API 7340, Lambda Function 7350. Each port has the same place in every block:
| Offset | Port |
| +0 | The app over HTTP, from Docker Compose or dotnet run |
| +1 | The app over HTTPS, dotnet run only |
| +2 | The Aspire dashboard |
| +3 | The collector's OTLP over gRPC |
| +4 | The collector's OTLP over HTTP |
| +5 | The MCP Inspector |
| +6 | The MCP chat demo |
| +7 to +9 | Spare |
docs/RUN.md lists the ports this solution uses. The app listens on its own port everywhere: under dotnet run, in the image (the Dockerfile sets ASPNETCORE_HTTP_PORTS, EXPOSE and the HEALTHCHECK to it) and in the compose file, so docker run -p maps it to the same number. Change all four together. The Lambda template is the one exception: Lambda's runtime interface emulator always listens on 8080 inside its container, so only the host side of its mapping is ours. The dashboard, the collector and other third-party images keep their usual ports inside (18888, 4317 and 4318), and only the host side of their mappings moves. A new service takes a spare port from the block, never a product's well-known one such as 3000, 5432 or 9000. docker compose port <service> <container port> prints where a port ended up.
Steps
- Keep restore before
COPY . .so a code change doesn't redo the restore layer. A new project folder needs nothing extra; the loops pick up everysrc/*/*.csprojandtests/*/*.csproj. - Anything the app writes goes under
/app/data, the only folder the app user can write to. - Pin every image in compose to a version. Dependabot keeps them current.
- Change base images through the
ARGs at the top, not inside aFROM. - Test locally with
docker compose up -d --build, then hit/health/readyand the API reference.
Don't
- Run the runtime image as root, or write outside
/app/data. - Use
:latestfor any image. - Add a push step to a registry.
- Copy secrets or
appsettings.*.jsonoverrides with real values into the image.
Check
docker build . --target run --tag local-check
docker compose up -d --build --wait # waits for the image's HEALTHCHECK
# Lambda: curl -fsS -X POST "http://$(docker compose port function 8080)/2015-03-31/functions/function/invocations" -d '{}'
docker compose downDoes 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.

