Docker イメージの構築、最適化、マルチステージビルド、ネットワーク、ボリューム管理。本番環境デプロイメント用のベストプラクティス。
Scanned 9/11/2026
Install to Claude Code
npx -y skills add phoroth/AGENTIC --skill docker-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Docker Patterns?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/phoroth-docker-patterns-agentic)More formats (shields.io, HTML) on the badges page.
---
name: docker-patterns
description: Docker イメージの構築、最適化、マルチステージビルド、ネットワーク、ボリューム管理。本番環境デプロイメント用のベストプラクティス。
origin: ECC
---
# Docker パターン
本番環境対応のDocker イメージとコンテナ。
## 使用時期
- Dockerfile を書く
- イメージサイズを最適化
- マルチステージビルド
- ネットワークと永続化を設定
- デプロイメント戦略
## Dockerfile ベストプラクティス
### 1. イメージサイズを最小化
```dockerfile
FROM node:18-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
FROM node:18-alpine
WORKDIR /app
COPY --from=build /app/node_modules ./node_modules
COPY . .
CMD ["node", "server.js"]
```
### 2. レイヤー最適化
```dockerfile
# キャッシュを活用するため、変更がない部分を上に
FROM node:18-alpine
WORKDIR /app
# 依存関係(変更が少ない)
COPY package*.json ./
RUN npm install
# アプリケーション(頻繁に変更)
COPY . .
CMD ["node", "server.js"]
```
### 3. セキュリティ
- root ユーザーで実行しない
- シークレットを避ける
- ヘルスチェック追加
```dockerfile
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node healthcheck.js
```
## docker-compose
```yaml
version: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
enprojectnment:
- NODE_ENV=production
volumes:
- ./data:/app/data
depends_on:
- db
db:
image: postgres:15
enprojectnment:
- POSTGRES_PASSWORD=secret
```
## チェックリスト
- [ ] イメージサイズ最適化
- [ ] セキュリティスキャン
- [ ] ヘルスチェック
- [ ] ログ管理
- [ ] ネットワーク構成
詳細については、ドキュメントを参照してください。
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!
Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.
Wire a service's OpenTelemetry output to Sematext Cloud. Walks through region, App-type, instrumentation flow (managed OTLP endpoint vs Sematext Agent), and signal selection (traces/metrics/logs), then produces the exact env-var block and points at a runnable reference example in this repo. Invoke when instrumenting a new app for Sematext.
Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications. Use when setting up deployment infrastructure or planning releases.
Watch a pull request or review cycle until it is ready to merge. Use when asked to babysit, monitor, or keep checking PR comments, reviews, and CI until all actionable issues are resolved.
Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.