docker
Dockerfile best practices, security hardening, multi-stage builds, and image optimization
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Dockerfile best practices, security hardening, multi-stage builds, and image optimization
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Angular component architecture, RxJS patterns, change detection, and module organization
Azure DevOps pipeline security, YAML structure, variable management, and deployment patterns
Azure Bicep IaC patterns, parameterization, security, and modular design
ASP.NET Core patterns, dependency injection, middleware, async/await, and security
FastAPI endpoint design, Pydantic validation, dependency injection, and async patterns
GitHub CLI (gh) comprehensive reference for repositories, issues, pull requests, Actions, projects, releases, gists, codespaces, organizations, extensions, and all GitHub operations from the command line.
| name | docker |
| description | Dockerfile best practices, security hardening, multi-stage builds, and image optimization |
| metadata | {"version":"1.1.0"} |
--build-arg to prevent injection attacks. Validate and escape externally-sourced values before using in ARG, ENV, or LABEL directives{{ }} and undeclared variables in Dockerfiles. Add linting step to scan for these patterns during reviewUSER directive)--privileged without justificationreadonly root filesystem where possiblelatest)alpine, slim, distroless)RUN commands to reduce layers.dockerignore to exclude unnecessary files, sensitive data, and build artifacts like node_modulesCOPY instead of ADD (unless extracting archives)WORKDIR before COPY/RUNEXPOSE for documentationLABEL metadataSHELL if bash/sh features are neededENV for configuration (not secrets)apt-get clean)ENTRYPOINT vs CMD: use ENTRYPOINT for main command, CMD for default argsorg.opencontainers.image.*)HEALTHCHECK instruction# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
# Runtime stage
FROM node:20-alpine
# Add OCI labels for documentation
LABEL org.opencontainers.image.title="My App"
LABEL org.opencontainers.image.description="Production web application"
LABEL org.opencontainers.image.version="1.0.0"
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
WORKDIR /app
# Copy dependencies and app files
COPY --from=builder /app/node_modules ./node_modules
COPY . .
# Set environment variables (not secrets)
ENV NODE_ENV=production
USER appuser
EXPOSE 3000
HEALTHCHECK CMD wget -q --spider http://localhost:3000/health || exit 1
# Use ENTRYPOINT for main command, CMD for default args
ENTRYPOINT ["node"]
CMD ["server.js"]