Watch files and sync/rebuild
Watches project files and applies sync or rebuild actions when configured.
docker compose watchUseful for tighter inner-loop development.
Developer workflows, troubleshooting commands, CI flows, and small-host production Compose patterns.
Common patterns for local development, tests, and one-off tasks.
Watches project files and applies sync or rebuild actions when configured.
docker compose watchUseful for tighter inner-loop development.
docker compose run --rm app pytest -qGreat for reproducible local and CI test runs.
docker compose run --rm app npm installUseful when the project expects toolchains inside the container.
docker compose up -d --scale worker=3Useful for queue consumers and basic horizontal scaling tests.
docker compose run --rm web python manage.py migrateCommon during deploy or local setup.
Common inspection and diagnosis commands.
docker compose config --quietUseful in pre-commit or CI validation steps.
docker compose ps -aHelpful for identifying crash loops and one-off exits.
docker compose logs --since=10m apiGood for focused debugging during incident response.
docker compose exec api env | sortUseful when debugging interpolation and config loading issues.
docker compose run --rm --entrypoint sh apiUseful when startup scripts or commands are failing.
docker inspect $(docker compose ps -q api)Helpful when you need low-level Docker details not shown by Compose.
Compose commands for automation pipelines.
docker compose -f compose.yaml -f compose.ci.yaml buildUseful for test tools, fake services, and cache controls.
Runs an integration stack and returns the test container exit code.
docker compose up --abort-on-container-exit --exit-code-from testA common pattern for integration test pipelines.
docker compose down -v --remove-orphansGood hygiene for repeatable automation.
docker compose pull && docker compose up -dSimple deployment flow for smaller self-hosted stacks.
Common patterns for small-host or self-hosted deployments.
services:
app:
image: myapp:${APP_TAG:-latest}
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:3000/health || exit 1"]
interval: 30s
timeout: 5s
retries: 3Useful for small-host production deployments and uptime monitoring.
services:
proxy:
image: nginx:alpine
ports:
- "80:80"
depends_on:
app:
condition: service_started
app:
image: myapp:${APP_TAG:-latest}Common for simple deployments on a single VM.
services:
db:
image: postgres:16
volumes:
- pgdata:/var/lib/postgresql/data
backup:
image: postgres:16
profiles: ["ops"]
depends_on:
- db
entrypoint: ["sh", "-c", "pg_dump -h db -U postgres appdb > /backup/appdb.sql"]
volumes:
- ./backup:/backup
volumes:
pgdata: {}Keeps maintenance commands versioned alongside the stack.