GitHub CopilotDockerArchitecture

Docker GitHub Copilot Instructions

GitHub Copilot instructions for Docker: Dockerfiles, Compose, and container best practices.

.github/copilot-instructions.md
- Generate multi-stage Dockerfiles with clear stage names (deps, builder, runner)
- Use the smallest appropriate base image; prefer alpine or distroless
- Copy package files first, install deps, then copy source to maximize cache hits
- Generate .dockerignore files excluding node_modules, .git, *.md, tests
- Add HEALTHCHECK instructions to all service Dockerfiles
- Generate non-root USER instructions before CMD/ENTRYPOINT
- Use docker-compose.yml with health checks and depends_on conditions
- Apply environment variable placeholders with sane defaults in docker-compose.yml

How to use with GitHub Copilot

Create `.github/copilot-instructions.md` in your repository. GitHub Copilot uses these to customize suggestions across your whole repo.

#docker#compose#copilot#github#coding-rules

Related Rules