Docker Compose Watch: Zero-Downtime Dev Loops (sync, sync+restart, rebuild)

Опубликовано: 25 Июнь 2026
на канале: Computering with Mike
11
1

Stop rebuilding your entire stack every time you change a file.

Docker Compose Watch gives you three targeted sync strategies — and in this video I'll show all three live: file sync, container restart, and full image rebuild — each triggered automatically when the right file changes.

⏱ Timestamps
0:00 The problem — 30-second rebuilds on every change
0:13 The solution — docker compose watch
0:32 ACT 1: sync — Python FastAPI + uvicorn --reload
0:58 ACT 2: sync+restart — Node.js Express
1:24 ACT 3: rebuild — requirements.txt triggers pip install
1:42 ACT 4: sync+restart — Nginx config reload
2:02 Gotchas (build: context, polling on macOS, ignore: filters)

🔗 Docs
https://docs.docker.com/compose/how-t...

🛠 What's covered
• sync — copies changed files into a running container (no restart)
• sync+restart — syncs then restarts the container process
• rebuild — detects dependency/config changes, rebuilds the image, restarts the service
• CHOKIDAR_USEPOLLING for Docker Desktop on macOS/Windows
• Using ignore: to avoid triggering on noisy paths

If you're running docker compose down && up on every code change, this is the fix.

#docker #dockercompose #devtools #containerized #webdev