Loading tutorials
build, ports, and command. It also assumes you know how a Dockerfile turns into an image, and that you have a Node.js-style project with source files and a package.json. You also need a recent Docker Compose v2 (watch arrived in version 6 min readbuild section must provide before you add any watch rules. It assumes you can read a Dockerfile, know what a layer is, and have written a Compose file with build, ports, and `6 min readbuild, ports and command, and that you know how images, containers and Dockerfiles relate. It also7 min readpath on the host and target in the container. It assumes you can write a Compose file with build, ports and command, and that you know what WORKDIR and COPY do in a Dockerfile. It also assumes you have seen6 min readsync action, the rule you will use most often in develop.watch. It assumes you can write a Compose file with build, ports, and command, and that you know what an image layer is. It also assumes you have a small web project with a dependency manifest such as `package6 min readpackage.json needs npm install to run, and that happens at image build time. The rebuild action in Compose Watch handles this case. When a watched file changes, Compose rebuilds the service image and recreates the contain7 min readignore and include attributes of a Compose Watch rule. It assumes you can already write a develop.watch section with a sync rule and start watch mode with docker compose watch. You also need to know what a .dockerignore file is.5 min readsync+restart action fixes this. It copies the changed file into the container and then restarts the container, so the process starts again and reads the ne6 min readsync+exec action in Compose Watch. It copies changed files into a running container and then runs a command inside that same container. It assumes you can already do the following:6 min readdevelop.watch section, start it with docker compose watch or docker compose up --watch, and read a Dockerfile. If any of that is unfamiliar, review the earlier chapters on the develop.watch section and on starting watch mode first.6 min readdevelop.watch section with sync, rebuild, sync+restart and sync+exec rules. It also assumes you can read container logs and run docker compose exec. The chapter gives you a fixed order for diagnosing a change that does not show up in the co6 min read