用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dev-Toolbelt/dev-team-agents --skill docker-dev命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | docker-dev |
| description | Docker dev — docker-compose, local Dockerfiles, container debugging. |
Canonical rule for every agent, not just devops. When Docker is the development environment, all commands and scripts run inside the appropriate container — never on the host.
| Task | Command form |
|---|---|
| Run a script or CLI command | docker compose exec <service> <command> |
| Run a one-off command | docker compose run --rm <service> <command> |
| Access a shell | docker compose exec <service> sh (or bash) |
app, api, backend, web, …)docker compose up -dDOCKER_COMPOSE: in the project's CLAUDE.md
(docker compose vs legacy docker-compose) — see skills/shared/stack-detection/SKILL.mdException: if the user explicitly asks for a command to run on the host ("run this locally"), honor it for that command only. The default reverts to in-container immediately after.
services:
app:
build:
context: .
dockerfile: docker/dev/Dockerfile
container_name: myproject-app
restart: unless-stopped
volumes:
- .:/app # bind mount for live code
- /app/vendor # anonymous volume to prevent host override
- /app/node_modules
ports:
- "8000:8000"
environment:
- APP_ENV=local
env_file:
- .env
depends_on:
db:
condition: service_healthy
cache:
condition: service_started
networks:
- myproject
db:
image: postgres:16-alpine
container_name: myproject-db
restart: unless-stopped
environment:
POSTGRES_DB: myproject
POSTGRES_USER: myproject
POSTGRES_PASSWORD:
[, ]
FROM node:20-alpine AS base
# or php:8.3-fpm-alpine, python:3.12-slim, etc.
WORKDIR /app
# Install system dependencies (rarely changes — cache this layer)
RUN apk add --no-cache git curl bash
# Copy dependency manifests only (cache layer)
COPY package*.json ./
RUN npm ci
# In dev: source code comes from bind mount, not COPY
# No COPY . . here
EXPOSE 3000
CMD ["npm", "run", "dev"]
Always add healthchecks to databases and services that have startup latency:
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 15s
Use docker-compose.override.yml (git-ignored) for per-developer customizations:
# docker-compose.override.yml (gitignored)
services:
app:
ports:
- "8001:8000" # different port if 8000 is taken locally
# Start
docker compose up -d
# Rebuild after Dockerfile change
docker compose up -d --build app
# Run one-off command
docker compose exec app bash
docker compose exec app npm run test
# See logs
docker compose logs -f app
# Stop and remove volumes (full reset)
docker compose down -v
| Problem | Cause | Fix |
|---|---|---|
| Permission errors on bind mount | Host/container user mismatch | Add user: "${UID}:${GID}" to service |
| Changes not reflected | Bind mount not set up | Check volume path in docker-compose.yml |
| DB not ready on start | Race condition | Use depends_on with condition: service_healthy |
node_modules override | Bind mount covers it | Add anonymous volume for node_modules |