Skill Market

docker patterns

Docker イメージの構築、最適化、マルチステージビルド、ネットワーク、ボリューム管理。本番環境デプロイメント用のベストプラクティス。

GitHub
githubcommunity
0.0
0 installs262.1K GitHub starsby affaan-m

Skill Introduction

Overview
Docker イメージの構築、最適化、マルチステージビルド、ネットワーク、ボリューム管理。本番環境デプロイメント用のベストプラクティス。

Core value

Turns reusable Other know-how into an installable skill, helping users complete github, community work faster.

Target users

  • Developers, testers, and maintainers who handle Other tasks in Focus Code.
  • Teams that already trust workflows or content from affaan-m.
  • Users who want standardized prompts, steps, or conventions instead of repeating setup work.

Best practices

  • Read the skill content first to confirm required inputs, expected outputs, and dependencies.
  • Try it on a small task before relying on it for critical work.
  • Add project-specific constraints such as coding style, target platform, test expectations, and delivery format.
  • For external sources, verify the source link, version, and recent maintenance activity.

Best use cases

  • Tasks related to github, community that need a reusable execution flow.
  • Converting a community repo, team convention, or personal workflow into day-to-day assistance.
  • Starting from a proven skill instead of writing prompts or procedures from scratch.

Limits and boundaries

  • Results depend on the quality of the original skill content and may need human correction.
  • It does not replace code review, tests, security review, or professional judgment.
  • External tools, APIs, account permissions, and local dependencies still need separate setup.

Differentiation

  • Structured around Other, making it easier to discover and reuse than loose prompt snippets.
  • Marked as GitHub, which helps users judge trust and maintenance expectations.
  • Keeps the original source link available for repository, documentation, or discussion follow-up.
  • Tagged with github, community, so it can be filtered by concrete task intent.

Install and use

Install
Copy Install Command
focus install docker-patterns-9ef163
View source

Detail Preview

SKILL.md

Primary filemarkdown2 KB

name: docker-patterns description: Docker イメージの構築、最適化、マルチステージビルド、ネットワーク、ボリューム管理。本番環境デプロイメント用のベストプラクティス。 origin: ECC

Docker パターン

本番環境対応のDocker イメージとコンテナ。

使用時期

  • Dockerfile を書く
  • イメージサイズを最適化
  • マルチステージビルド
  • ネットワークと永続化を設定
  • デプロイメント戦略

Dockerfile ベストプラクティス

1. イメージサイズを最小化

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. レイヤー最適化

# キャッシュを活用するため、変更がない部分を上に
FROM node:18-alpine
WORKDIR /app

# 依存関係(変更が少ない)
COPY package*.json ./
RUN npm install

# アプリケーション(頻繁に変更)
COPY . .

CMD ["node", "server.js"]

3. セキュリティ

  • root ユーザーで実行しない
  • シークレットを避ける
  • ヘルスチェック追加
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
  CMD node healthcheck.js

docker-compose

version: '3.8'
services:
  app:
    build: .
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
    volumes:
      - ./data:/app/data
    depends_on:
      - db
  db:
    image: postgres:15
    environment:
      - POSTGRES_PASSWORD=secret

チェックリスト

  • イメージサイズ最適化
  • セキュリティスキャン
  • ヘルスチェック
  • ログ管理
  • ネットワーク構成

詳細については、ドキュメントを参照してください。

Reviews

Overall rating

0.0
0.0

0 comments

No reviews yet