docker-compose

GitHub

提供 Docker Compose 本地开发配置规范,涵盖服务定义、卷管理、环境变量及健康检查。强调通过 docker compose config 进行验证而非直接启动,确保环境安全与依赖正确性。

skills/docker-compose/SKILL.md AjayIrkal23/agentic-mercy-10x

Trigger Scenarios

需要编写或审查 docker-compose.yaml / compose.yaml 文件时 询问关于容器编排、依赖顺序或健康检查最佳实践时

Install

npx skills add AjayIrkal23/agentic-mercy-10x --skill docker-compose -g -y
More Options

Use without installing

npx skills use AjayIrkal23/agentic-mercy-10x@docker-compose

指定 Agent (Claude Code)

npx skills add AjayIrkal23/agentic-mercy-10x --skill docker-compose -a claude-code -g -y

安装 repo 全部 skill

npx skills add AjayIrkal23/agentic-mercy-10x --all -g -y

预览 repo 内 skill

npx skills add AjayIrkal23/agentic-mercy-10x --list

SKILL.md

Frontmatter
{
    "name": "docker-compose",
    "metadata": {
        "schema": 1,
        "category": "general",
        "surfaces": [
            "backend"
        ],
        "triggers": {
            "intents": [],
            "keywords": [
                "docker compose",
                "docker-compose",
                "compose file",
                "compose.yaml",
                "docker-compose.yml",
                "healthcheck",
                "service_healthy",
                "depends_on",
                "dockerfile",
                "named volume",
                "container"
            ]
        },
        "platforms": [
            "linux",
            "darwin",
            "windows"
        ]
    },
    "description": "Docker Compose files for local dev and small deployments: services, named volumes, env files, healthchecks with depends_on conditions, and validation with docker compose config without bringing a stack up.",
    "when_to_use": "Use when writing or reviewing compose.yaml \/ docker-compose.yml, Dockerfiles for those services, healthchecks or local dev databases."
}

Docker Compose

Never run docker compose up (or start, run, restart) unless the user asks. Bringing a stack up starts servers, binds ports and can write into volumes; validation does not need it.

File shape

  • Name it compose.yaml (or keep the repo's existing docker-compose.yml); no top-level version: key (obsolete in Compose v2).
  • One service per process; build app images from a Dockerfile, pin third-party images to a major.minor tag (mongo:7.0), never latest.
  • Data in named volumes (volumes: { mongo-data: {} }), source code in bind mounts only for dev hot-reload.
  • Config through env_file: .env plus environment: for non-secret values; commit a .env.example, never the .env. Secrets do not go into the compose file or the image.
  • Publish only the ports a person needs from the host; services talk over the default network by service name (mongodb://mongo:27017/app).

Healthchecks and start order

services:
  mongo:
    image: mongo:7.0
    volumes: [mongo-data:/data/db]
    healthcheck:
      test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping').ok"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 20s
  api:
    build: ./server
    env_file: .env
    depends_on:
      mongo:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:3000/health"]
      interval: 15s
      timeout: 5s
      retries: 3
volumes:
  mongo-data: {}
  • depends_on without condition: service_healthy only orders container start, not readiness.
  • The healthcheck command must exist inside the image (wget is in Alpine/BusyBox, curl often is not); the app exposes a cheap health route that does not hit every dependency.

Dockerfile for the app service

Multi-stage: install with the lockfile (npm ci), build, then copy only the runtime output and production deps into a slim final stage; run as a non-root user; a .dockerignore excludes node_modules, .env, .git, build output.

Validate without starting anything

docker compose config --quiet          # schema + interpolation check, exits non-zero on error
docker compose config --services       # the services it will create
hadolint Dockerfile                     # if installed

docker compose build is acceptable when the user wants the image checked; it starts no containers. Report what still needs a real up (healthchecks passing, ports reachable) as the user's step.

Not this skill

CI pipelines (ci-cd-and-automation), production rollout and rollback (shipping-and-launch), Kubernetes manifests.

Version History

  • 2315578 Current 2026-10-18 19:20

Same Skill Collection

skills/agentation-react/SKILL.md
skills/baseline-ui/SKILL.md
skills/brand/SKILL.md
skills/context7-mcp/SKILL.md
skills/create-design-md/SKILL.md
skills/debug-broken-ui/SKILL.md
skills/design-system-compliance/SKILL.md
skills/design-taste-frontend/SKILL.md
skills/design/SKILL.md
skills/ensure-repo-docs/SKILL.md
skills/expo-react-native/SKILL.md
skills/false-green-tests/SKILL.md
skills/fastify-patterns/SKILL.md
skills/fixing-accessibility/SKILL.md
skills/fixing-metadata/SKILL.md
skills/fixing-motion-performance/SKILL.md
skills/grill-with-docs/SKILL.md
skills/higgsfield-brandkit/SKILL.md
skills/higgsfield-video-explainer/SKILL.md
skills/higgsfield-youtube-thumbnail/SKILL.md
skills/idea-refine/SKILL.md
skills/img2threejs/SKILL.md
skills/improve-ui/SKILL.md
skills/invoke-audit/SKILL.md
skills/invoke-clean/SKILL.md
skills/invoke-debug/SKILL.md
skills/invoke-design/SKILL.md
skills/invoke-docs/SKILL.md
skills/invoke-impl/SKILL.md
skills/invoke-plan/SKILL.md
skills/invoke-refactor/SKILL.md
skills/invoke-review/SKILL.md
skills/invoke-security/SKILL.md
skills/invoke-session/SKILL.md
skills/invoke-spec/SKILL.md
skills/invoke-status/SKILL.md
skills/invoke-test/SKILL.md
skills/invoke-update/SKILL.md
skills/invoke-verify/SKILL.md
skills/invoke/SKILL.md
skills/kokonutui/SKILL.md
skills/mmx-cli/h3-video/SKILL.md
skills/modern-web-guidance/SKILL.md
skills/mongoose-patterns/SKILL.md
skills/no-ai-slop/SKILL.md
skills/slides/SKILL.md
skills/test-error-states/SKILL.md
skills/threejs-r3f/SKILL.md
skills/to-issues/SKILL.md

Metadata

Files
0
Version
2315578
Hash
312577a1
Indexed
2026-10-18 19:20

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-19 11:11
浙ICP备14020137号-1