一键导入
docker-compose-development
Master the workflow for developing applications using Docker Compose with source code mounting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Master the workflow for developing applications using Docker Compose with source code mounting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | Docker Compose Development |
| description | Master the workflow for developing applications using Docker Compose with source code mounting. |
This skill provides best practices and workflows for developing applications running in Docker Compose, specifically focusing on services that mount source code for development (hot-reload).
Before taking any action, ALWAYS analyze the docker-compose.yml file to understand the environment.
Checklist:
./backend:/app).
docker compose ps
If a service mounts source code (e.g., volumes: - ./src:/app), DO NOT REBUILD the container for simple code changes.
If you modify requirements.txt, package.json, Dockerfile, or unmounted files:
Action: Rebuild ONLY the specific service.
docker compose up -d --build <service_name>
Note: This is faster than rebuilding everything.
If you create a new file, ensure it is within the mounted directory.
docker-compose.yml or rebuild.CRITICAL: Always run tests INSIDE the container to ensure the environment matches production/CI. DO NOT run tests locally unless explicitly asked.
Syntax:
docker compose exec <service_name> <test_command>
Common Examples:
docker compose exec <backend_service_name> pytest tests/ -v
docker compose exec <frontend_service_name> npm test
To check for errors or verify startup:
docker compose logs --tail=100 -f <service_name>
To explore the container filesystem or debug manually:
docker compose exec <service_name> /bin/bash
# If bash is missing, try:
docker compose exec <service_name> sh
If hot-reload fails or application hangs:
docker compose restart <service_name>
Scenario: You added a new endpoint to backend service (FastAPI).
app/routers/new_api.py (Local file)../app is mounted to container.docker compose logs -f backend to see if it reloaded.docker compose exec backend pytest tests/test_new_api.py.