Docker Compose file · Profiles, development and reuse
Sync or rebuild on file changes
Update running containers as you edit code, with docker compose watch.
services:
web:
build: .
develop:
watch:
- action: sync
path: ./src
target: /app/src
- action: rebuild
path: package.json
Official Docker Compose file documentation
More profiles, development and reuse commands
- Make services optional
- Override settings for development
- Include another Compose file
- Avoid repetition with anchors
All profiles, development and reuse commands · Docker Compose file cheatsheet