Skip to content

Docker Compose Watch: live updates while you code

Select an icon to see what it is.

Step 1 of 6

Rules in the file say what to do

Under a service, develop.watch lists rules, each with a path on the host and an action. sync copies changed files into the container, sync+restart copies them and restarts the container, and rebuild builds the image again and recreates the container. Rules can also use ignore patterns.

PrevNext

compose.yaml (excerpt)

develop:
watch:
- action: sync
path: ./html
target: /usr/share/nginx/html
- action: sync+restart
path: ./nginx.conf
target: /etc/nginx/nginx.conf
- action: rebuild
path: ./Dockerfile