docker-compose ناجح

创建和管理多容器应用的Docker Compose配置,包含生产级设置、健康检查和网络配置。

51من ١٠٠
٨٢
نجوم
٨
تنزيلات
٣٣
مشاهدات

// تثبيت المهارة

تثبيت المهارة

المهارات هي كود تابع لأطراف ثالثة من مستودعات GitHub العامة. يفحص SkillHub الأنماط الخبيثة المعروفة، لكنه لا يستطيع ضمان السلامة. راجع الكود المصدري قبل التثبيت.

تثبيت عام (على مستوى المستخدم):

npx skillhub install majiayu000/claude-skill-registry/docker-compose

تثبيت في المشروع الحالي:

npx skillhub install majiayu000/claude-skill-registry/docker-compose --project

skill.install.customTargetHelp

npx skillhub install majiayu000/claude-skill-registry/docker-compose --target-dir /path/to/skills

المسار المقترح: ~/.claude/skills/docker-compose/

مراجعة الذكاء الاصطناعي

51
من ١٠٠
جودة التعليمات42
دقة الوصف38
الفائدة61
السلامة التقنية68

Scored 51 for solid production-grade Docker Compose templates with current image versions and proper healthchecks. Penalized for Chinese-only YAML description with no English trigger phrases, no step-by-step workflow (just templates), and no troubleshooting or adaptation guidance. Useful as a reference but requires manual adaptation.

betasimplebackend-devsdevopsdocker-composecontainerizationmulti-service-apps
تمت المراجعة بواسطة claude-code في 6‏/5‏/2026

محتوى SKILL.md

---
name: docker-compose
description: 创建和管理多容器应用的Docker Compose配置,包含生产级设置、健康检查和网络配置。
metadata:
  short-description: 生成Docker Compose配置
---

# Docker Compose Skill

## Description
Create Docker Compose configurations for multi-container applications with best practices.

## Trigger
- `/docker` command
- User requests Docker configuration
- User needs containerization help

## Prompt

You are a Docker expert that creates production-ready container configurations.

### Web Application Stack

```yaml
version: '3.8'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
      - DATABASE_URL=postgresql://user:pass@db:5432/myapp
      - REDIS_URL=redis://redis:6379
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_started
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
      interval: 30s
      timeout: 10s
      retries: 3
    restart: unless-stopped
    networks:
      - app-network

  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: user
      POSTGRES_PASSWORD: pass
      POSTGRES_DB: myapp
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U user -d myapp"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - app-network

  redis:
    image: redis:7-alpine
    command: redis-server --appendonly yes
    volumes:
      - redis_data:/data
    networks:
      - app-network

  nginx:
    image: nginx:alpine
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
      - ./certs:/etc/nginx/certs:ro
    depends_on:
      - app
    networks:
      - app-network

volumes:
  postgres_data:
  redis_data:

networks:
  app-network:
    driver: bridge
```

### Development Override

```yaml
# docker-compose.override.yml
version: '3.8'

services:
  app:
    build:
      target: development
    volumes:
      - .:/app
      - /app/node_modules
    environment:
      - NODE_ENV=development
    command: npm run dev

  db:
    ports:
      - "5432:5432"
```

### Multi-Stage Dockerfile

```dockerfile
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production

# Production stage
FROM node:20-alpine AS production
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY . .
USER node
EXPOSE 3000
CMD ["node", "dist/main.js"]
```

## Tags
`docker`, `containers`, `devops`, `infrastructure`, `orchestration`

## Compatibility
- Codex: ✅
- Claude Code: ✅

الترخيص

الترخيص المُعلن: MIT

MIT License

Copyright (c) 2026 majiayu000

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

عرض الترخيص في المستودع المصدريالنسخة المنشورة هناك هي المرجع.