Skip to main content

docker-compose

Work with the Docker Compose development environment. Use when: starting or stopping services, inspecting logs, opening a shell in a container, resetting the database, or understanding the service topology.

来源信息

仓库
tedivm/robs_awesome_python_template_examples
最近来源活动
2026年5月18日 12:11
检测到的 SKILL.md 语言
英语
星标
16
分支
1

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
docker-compose
description
Work with the Docker Compose development environment. Use when: starting or stopping services, inspecting logs, opening a shell in a container, resetting the database, or understanding the service topology.
# Docker Compose Development Environment > **context7**: If the `mcp_context7` tool is available, resolve and load the full Docker Compose documentation before modifying `compose.yaml` or using advanced CLI options: > ``` > mcp_context7_resolve-library-id: "docker compose" > mcp_context7_get-library-docs: /docker/compose > ``` The development environment runs entirely through Docker Compose. All services are defined in `compose.yaml`. --- ## Services | `www` | FastAPI application server | | `celery-scheduler` | Celery Beat scheduler for periodic tasks | | `celery-node` | Celery worker for background tasks | | `qq` | QuasiQueue multiprocessing runner | | `db` | PostgreSQL database | | `redis` | Redis cache / task broker | --- ## Essential Commands ### Start / Stop ```bash # Start all services in the background docker compose up -d # Start with live rebuild on file changes docker compose up --watch # Stop all services (preserves volumes — data is retained) docker compose down # Stop all services AND remove volumes (full reset — destroys all data) docker compose down --volumes --remove-orphans # Restart all services without destroying containers or volumes docker compose restart # Restart a single service docker compose restart www ``` ### Logs ```bash # View recent logs from all services docker compose logs # Follow (tail) logs from all services in real-time docker compose logs -f # Follow logs from a specific service docker compose logs -f www ``` ### Status and Inspection ```bash # List running services and their status docker compose ps # Open a bash shell inside a running service docker compose exec www bash ``` --- ## Common Workflows ### Start a fresh development environment ```bash docker compose up -d docker compose logs -f # watch until all services are healthy ``` ### Full reset (wipe all data and restart) ```bash docker compose down -v docker compose up -d ``` ### Debug a service startup failure ```bash docker compose logs --tail 50 www # or follow real-time: docker compose logs -f www ``` ### Run a one-off command inside a service ```bash # Run in a new container (use for migrations, one-off scripts) docker compose run --rm www bash # Execute in an already-running container (use for debugging live services) docker compose exec www bash ``` --- ## Notes - All Docker-specific files (Dockerfiles, prestart scripts) live in the `docker/` folder. - The developer `.env` file is loaded automatically by Compose — make sure it's populated before starting. --- ## Further Reading - [docs/dev/docker.md](../../docs/dev/docker.md) — Full Docker developer guide covering service topology, volume management, hot-reload behavior, and multi-service debugging. - [Docker Compose Docs](https://docs.docker.com/compose/)
在 GitHub 查看