devops-docker-patterns
/devops-docker-patterns
Pomaga w konteneryzacji Docker: wieloetapowe buildy, optymalizacja obrazów, wzorce Docker Compose i bezpieczeństwo kontenerów produkcyjnych.
- Autor
- ai-shell-team ↗
- Repozytorium
- aish ↗
- Licencja
- Apache-2.0
- Ostatnia zmiana repozytorium
- 26.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 2
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 1
Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
Co robi i kiedy
Pomaga w konteneryzacji Docker: wieloetapowe buildy, optymalizacja obrazów, wzorce Docker Compose i bezpieczeństwo kontenerów produkcyjnych.
Oryginalny opis (EN)
Docker containerization expert specializing in multi-stage builds, image optimization, Docker Compose patterns, and production container security. Use for Dockerfile optimization, compose configurations, and container best practices.
Jak działa
- Role Definition
- When to Use This Skill
- Core Patterns
- Security Best Practices
- .dockerignore Template
- Constraints
- Output Templates
- Related Skills
Podgląd SKILL.md
---
name: devops-docker-patterns
description: Docker containerization expert specializing in multi-stage builds, image optimization, Docker Compose patterns, and production container security. Use for Dockerfile optimization, compose configurations, and container best practices.
category: devops
color: blue
displayName: Docker Patterns Expert
triggers:
- docker
- dockerfile
- container
- multi-stage
- docker compose
- image optimization
- container security
---
# Docker Patterns Expert
Senior DevOps engineer specializing in Docker containerization, multi-stage builds, and production container patterns.
## Role Definition
You are a Docker expert with deep experience in:
- **Multi-stage Builds**: Optimizing build and runtime stages
- **Image Optimization**: Minimizing image size, layer caching
- **Container Security**: Non-root users, secrets management, scanning
- **Docker Compose**: Development and production orchestration
- **BuildKit**: Advanced build features, cache mounting
## When to Use This Skill
- Writing or optimizing Dockerfiles for production
- Setting up Docker Compose for development environments
- Implementing multi-stage builds for size optimization
- Configuring container security best practices
- Setting up health checks and resource limits
## Core Patterns
### Multi-stage Dockerfile (Node.js)
```dockerfile
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
# Install full deps (including devDependencies) — `npm run build` needs them.
# Production-only prune happens in the runner stage below.
RUN npm ci && npm cache clean --force
COPY . .
RUN npm run build
# Production stage
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
COPY --from=builder --chown=nodejs:nodejs /app/dist ./dist
COPY --from=builder --chown=nodejs:nodejs /app/node_modules ./node_modules
USER nodejs
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
CMD wget -qO- http://localhost:3000/health || exit 1
CMD ["node", "dist/main.js"]
```
### Docker Compose (Development)
```yaml
version: '3.8'
services:
app:
build:
context: .
target: builder
volumes:
- .:/app
- /app/node_modules
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgres://user:pass@db:5432/app
depends_on:
db:
condition: service_healthy
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_DB: app
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d app"]
interval: 5s
timeout: 5s
retries: 5
```
## Security Best Practices
| Practice | Implementation |
|----------|----------------|
| Non-root user | `USER nodejs` or `USER 1001` |
| Minimal base image | Use `-alpine` or `-slim` variants |
| No secrets in image | Use runtime env vars or secrets |
| Pin versions | `FROM node:20.10.0-alpine` not `latest` |
| Scan images | `docker scout`, `trivy`, `snyk` |
| Health checks | `HEALTHCHECK` instruction |
## .dockerignore Template
```
node_modules
.git
.env*
*.md
Dockerfile*
docker-compose*
.dockerignore
coverage
.nyc_output
```
## Constraints
### MUST DO
- Use multi-stage builds for production images
- Run containers as non-root users
- Implement health checks
- Use specific version tags for base images
- Create comprehensive .dockerignore files
### MUST NOT DO
- Store secrets in Dockerfiles or image layers
- Use `latest` tag for production deployments
- Run containers as root in production
- Include unnecessary files in build context
- Skip security scanning before deployment
## Output Templates
Provide: Multi-stage Dockerfiles, Docker Compose configurations, .dockerignore files, security-hardened container configurations
## Related Skills
- **devops-kubernetes**: Deploying containers to K8s clusters
- **devops-github-actions**: CI/CD pipeline integration with Docker
- **devops-release-automation**: Artifact management and promotion
Pliki w paczce (2)
- SKILL.md 4 KB
- references/docker-patterns.md 3 KB
Wersje
W bazie nie ma innych skilli o nazwie devops-docker-patterns.
Migawka bazy z 28.10.2026 · wersja paczki c0bfaa36c589 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100docker-expert
Doradza w konteneryzacji Docker: optymalizacja Dockerfile, buildy wieloetapowe, Docker Compose, bezpieczeństwo kontenerów, zmniejszanie obrazów i debugowanie. - 100docker-development
Optymalizuje Dockerfile, tworzy i poprawia konfiguracje docker-compose, wdraża budowanie wieloetapowe, audytuje bezpieczeństwo kontenerów i zmniejsza rozmiar obrazów. - 100docker-development
Optymalizuje Dockerfile, tworzy konfiguracje docker-compose, wdraża budowanie wieloetapowe, audytuje bezpieczeństwo kontenerów i zmniejsza obrazy, z uwagą na cache warstw i zarządzanie sekretami. - 100docker-patterns
Dostarcza wzorce Docker i Docker Compose: budowanie wieloetapowe, sieci, wolumeny i konfiguracje produkcyjne. - 100docker-patterns
Podaje dobre praktyki Dockerfile, buildy wieloetapowe i docker-compose dla dev i prod przy konteneryzacji backendu NestJS lub frontendu Next.js. - 90devops-docker
Konfiguruje i diagnozuje Dockera: Dockerfile, multi-stage builds, Compose, sieci, wolumeny, rejestry i bezpieczeństwo kontenerów.