Docker Compose Experiment Sync Files and Automatically Rebuild Services with Watch Mode
December 8, 2025 · 541 words · 3 min
We often hear how indispensable is as a development tool. Running offers a streamlined experienc
We often hear how indispensable is as a development tool. Running offers a streamlined experience and scales from quickly standing up a PostgreSQL database to building 50+ services across multiple platforms. And, although “building a Docker image” was previously considered a last step in release pipelines, it’s safe to say that containers have since become an essential part of our daily workflow. Still, concerns around slow builds and developer experience have often been a barrier towards the adoption of containers for local development. We’ve come a long way, though. For starters, now has deep integration with , so you can use features like , , and efficient to speed up and simplify your builds. We’re also constantly making quality-of-life tweaks like and improving consistency across the Docker CLI ecosystem. As a result, more developers are running to keep their running development environment up-to-date as they make code changes. In some cases, you can even use bind mounts combined with a framework that supports hot reload to avoid the need for an image rebuild, but this approach often comes with its own set of caveats and limitations. Starting with Compose v2.17, we’re excited to share an early look at the new development-specific configuration in Compose YAML as well as an experimental file watch command (Figure 1) that will automatically update your running Compose services as you edit and save your code. This preview is brought to you in no small part by Compose developer Nicolas De Loof (in addition to more than 10 bugfixes in this release alone). An optional new section, , can be added to a Compose service to configure options specific to your project’s daily flow. In this release, the only available option is , which allows you to define file or directory paths to monitor on your computer and a corresponding action to take inside the service container. Currently, there are two possible actions: In the preceding example, whenever a source file in the directory is changed, Compose will copy the file to the corresponding location under inside the container. Because Webpack supports Hot Module Reload, the changes are automatically detected and applied. Unlike source code files, adding a new dependency cannot be done on the fly, so whenever is changed, Compose will rebuild the image and recreate the service container. Behind the scenes, the file watching code shares its core with Tilt. The intricacies and surprises of file watching have always been near and dear to the Tilt team’s hearts, and, , the geeking out has continued. We are going to continue to build out the experience while gated behind the new command and Compose YAML section. This approach will allow us to respond to community feedback early in the development process while still providing a clear path to stabilization as part of the Compose Spec. Docker Compose powers countless workflows today, and its lightweight approach to containerized development is not going anywhere — it’s just learning a few new tricks. Follow the instructions at to quickly run a small demo app, as follows: If you try it out on your own project, you can comment on the proposed specification on .