new-dockerfile

new-dockerfile is a command for GitHub Copilot from srnichols/plan-forge. It costs 25 tokens per session (777 once invoked), scanned A, original, MIT.

A command that creates a multi-stage Dockerfile for a .NET application, plus a Docker ignore file. The image builds the app separately from its smaller runtime image and runs it as a non-root user.

In plain words
What is it for?
Use it to package a .NET service into a production container with a health check, port configuration, and a distroless-style runtime setup.
Why use it?
It avoids repeatedly writing container setup and helps keep build output out of the final image. Layer ordering also lets Docker reuse dependency-install steps when source files change.

Command for GitHub Copilot

Written for GitHub Copilot: a Copilot chat mode or prompt. Also seen: agent in frontmatter.

Good fit Use it to package a .NET service into a production container with a health check, port configuration, and a distroless-style runtime setup.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/srnichols/plan-forge/new-dockerfile
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/srnichols/plan-forge

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for new-dockerfile

README.md
[![agentmods](https://agentmods.dev/badge/commands/srnichols/plan-forge/new-dockerfile/github.svg)](https://agentmods.dev/commands/srnichols/plan-forge/new-dockerfile)
Your own site
<a href="https://agentmods.dev/commands/srnichols/plan-forge/new-dockerfile"><img src="https://agentmods.dev/badge/commands/srnichols/plan-forge/new-dockerfile/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for new-dockerfile

Your own site · 80×15
<a href="https://agentmods.dev/commands/srnichols/plan-forge/new-dockerfile"><img src="https://agentmods.dev/badge/commands/srnichols/plan-forge/new-dockerfile.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 777 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.00777
Opus 5 $0.00013 $0.00388
Sonnet 5 $0.00005 $0.00155
Haiku 4.5 $0.00003 $0.00078

Measured today against content hash 687cdae318b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

new-dockerfile scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1
presets/dotnet/.github/prompts/new-dockerfile.prompt.md · 115 lines

How it starts

The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Create New Dockerfile

Scaffold a production-grade multi-stage Dockerfile for a .NET application.

Required Pattern

Multi-Stage Dockerfile

# ---- Build Stage ----
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
WORKDIR /src

# Copy csproj files first for layer caching
COPY *.sln ./
COPY src/{ProjectName}/*.csproj src/{ProjectName}/
COPY tests/{ProjectName}.Tests/*.csproj tests/{ProjectName}.Tests/
RUN dotnet restore

# Copy everything else and build
COPY . .
RUN dotnet publish src/{ProjectName}/{ProjectName}.csproj \
    -c Release \
    -o /app/publish \
    --no-restore \
    /p:UseAppHost=false

# ---- Runtime Stage ----
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS runtime
WORKDIR /app

# Security: run as non-root
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
USER appuser

COPY --from=build /app/publish .

EXPOSE 8080
ENV ASPNETCORE_URLS=http://+:8080
ENV DOTNET_EnableDiagnostics=0

HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
    CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1

ENTRYPOINT ["dotnet", "{ProjectName}.dll"]

.dockerignore

**/bin/
**/obj/
**/node_modules/
**/.vs/
**/.vscode/
**/Dockerfile*
**/.dockerignore
**/.git
**/.gitignore
*.md

Docker Compose (Development)

services:
  api:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "8080:8080"
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - ConnectionStrings__Default=Host=db;Database=mydb;Username=postgres;Password=postgres
    depends_on:
      db:
        condition: service_healthy

  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: mydb
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 3s
      retries: 5

volumes:
  pgdata:

Rules

Read the full file on GitHub · 115 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 115 lines · 25 tokens per session scan A 687cdae318b0

Subscribe to this mod's changes

new-dockerfile is a command published in the GitHub repository srnichols/plan-forge (5 stars, last pushed yesterday), licensed MIT. It adds 25 tokens to every session and 777 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-08.