Builds, runs, and debugs Docker Compose setups for examples. Use when Docker builds fail, containers won't start, inter-container networking breaks, or when debugging multi-service agent deployments.
Trigger this skill when:
docker compose up --build fails or a container exits unexpectedlyUse the Docker MCP (project-0-agent-patterns-lab-docker) for inspection:
| Tool | Purpose |
|---|---|
list_containers | See running/stopped containers and their status |
fetch_container_logs | Read stdout/stderr from a specific container |
list_images | Check built images and tags |
list_networks | Inspect Docker networks for multi-service setups |
list_volumes |
| Check persistent volumes (PostgreSQL, etc.) |
start_container / stop_container | Control individual containers |
recreate_container | Rebuild and restart a single container |
Check container status
list_containers to see which containers are running, exited, or restarting0 = clean stop, 1 = app error, 137 = OOM killedRead logs for the failing container
fetch_container_logs with the container nameVerify network connectivity (multi-service)
list_networks to confirm all services share a networkservices: keys in docker-compose.ymlCheck image build
list_images to verify the image was builtFix and rebuild
docker compose up --build to rebuildAll examples use the base Dockerfile at infra/docker/base/Dockerfile.agent:
../.. from the example)PACKAGE_NAME, EXAMPLE_PYPROJECT, and EXAMPLE_SRC for that examplebuilder installs deps, runtime copies artifacts.env file is passed via env_file in docker-compose| Symptom | Likely Cause | Fix |
|---|---|---|
ModuleNotFoundError | Dependency missing in pyproject.toml | uv add <package> in the example, rebuild |
Connection refused on port 8000 | App not binding to 0.0.0.0 | Set --host 0.0.0.0 in uvicorn command |
| Container restarts in loop | Crash on startup (missing env var) | Check .env file, compare with .env.example |
network X not found | Compose network not created | Run docker compose down then up again |
Build fails at uv sync | Lock file out of sync | Run uv lock locally first, then rebuild |
# Build and run from example directory
docker compose up --build
# Rebuild single service
docker compose up --build agent
# View logs for a service
docker compose logs -f agent
# Full reset (remove containers, networks, volumes)
docker compose down -v