avibebuilder/claude-prime / .claude/starter-skills/docker
docker
VerifiedALWAYS activate when the user's query involves Docker in any way — even if it also matches other skills. If the words docker, Dockerfile, docker-compose, compose.yml, container, or image appear in the query, this skill MUST be used. Covers: writing or editing Dockerfiles and compose files, adding services (postgres, redis, etc.) to compose, volume mounts and data persistence, docker build failures (layer caching, npm install issues), healthchecks and service startup ordering (depends_on), environment variables in containers, port mapping, container crashes and exit codes (OOM/137), non-root users, multi-stage builds, image optimization, .dockerignore, and deploying to container runtimes. Takes priority over general implementation or debugging skills when Docker infrastructure is the subject.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.1 KB |
| references/compose.md | markdown | 1.7 KB |
| references/dockerfile.md | markdown | 2.4 KB |
| references/production.md | markdown | 2.3 KB |
| references/security.md | markdown | 1.3 KB |
references/production.md
View on GitHub# Docker Production Configuration
## Healthchecks
HEALTHCHECK instructions monitor container health and enable automatic restart.
```dockerfile
# HTTP-based health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
# TCP port check
HEALTHCHECK --interval=10s --timeout=5s CMD nc -z localhost 5432 || exit 1
# Custom command check
HEALTHCHECK --interval=30s CMD /app/check-health.sh || exit 1
```
## Restart Policies
Configure automatic container restart in `docker-compose.yml`:
```yaml
services:
web:
restart_policy:
condition: unless-stopped
delay: 5s
max_attempts: 3
```
Options: `no`, `always`, `unless-stopped`, `on-failure`
## Resource Limits
```yaml
services:
app:
mem_limit: 512m # Maximum memory usage
memswap_limit: 768m # Max memory + swap
cpus: '1.5' # CPU shares
pids_limit: 200 # Max processes
```
## Logging Configuration
```yaml
services:
app:
logging:
driver: json-file
options:
max-size: '10m' # Rotation threshold
max-file: '3' # Files to keep
labels: 'service=api'
```
## Docker Compose Watch (Development)
Enable file synchronization and automatic rebuilds:
```yaml
services:
web:
build: .
watch:
- action: sync
path: ./src
target: /app/src
- action: rebuild
path: package.json
```
Run with: `docker compose watch`
## Production vs Development Comparison
| Aspect | Development | Production |
|--------|-------------|------------|
| **Restart** | `no` or `on-failure` | `unless-stopped` |
| **Logging** | Console, all levels | json-file, limited rotation |
| **Resources** | Unlimited | Limits set for stability |
| **Healthchecks** | Optional | Required for orchestration |
| **Watch** | `docker compose watch` | N/A (static images) |
| **Image Tags** | `latest`, dev | Specific versions (semver) |
## Production Checklist
- Define HEALTHCHECK in Dockerfile
- Set appropriate restart policies
- Configure resource limits to prevent memory leaks
- Use json-file logging with rotation
- Pin image versions, never use `latest`
- Run `docker compose up -d` for background services
- Monitor container logs: `docker logs --follow <container>`
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |