Visitar URL original
[BUG] docker compose watch fails to sync file changes for Node.js app when using bind mounts on Linux · Issue #13743 · docker/compose · GitHub
Skip to content

[BUG] docker compose watch fails to sync file changes for Node.js app when using bind mounts on Linux #13743

Description

@Vansh1811

Description

Current behavior:
When running docker compose watch with a Node.js service on Linux, file changes in ./src are not synced to the container. The sync action does not detect host file modifications.

Expected behavior:
docker compose watch should detect file changes in watched paths and sync them to the container in real-time, enabling hot-reload without full restarts.

Steps To Reproduce

  1. Create a Node.js project with a compose.yml using develop.watch with sync action
  2. Run docker compose watch
  3. Edit a .js file inside ./src on the host
  4. Observe that the running container does NOT reflect the updated file
  5. Restarting the service shows the file — confirming the sync is broken

Compose Version


Docker Environment

Client: Docker Engine - Community
 Version: 26.1.3
 Context: default
 OS/Arch: linux/amd64
 Compose version: v2.27.1

Server:
 Engine: Version: 26.1.3
 OS/Arch: linux/amd64
 Kernel Version: 5.15.0-107-generic
 Storage Driver: overlay2
 Logging Driver: json-file
 Cgroup Driver: systemd

Anything else?

No response

Activity

  1. ndeloof commented on Apr 20, 2026

    @ndeloof
    Contributor

    please attach the watch section from your compose file for further analysis

  2. Vansh1811 commented on Apr 20, 2026

    @Vansh1811
    Author

    Thanks for looking into this! Here's the develop.watch section from my compose.yml:

    services:
      app:
        build: .
        volumes:
          - ./src:/app/src
        develop:
          watch:
            - action: sync
              path: ./src
              target: /app/src
              ignore:
                - node_modules/

    Running Node.js with nodemon. File changes to ./src on the host are not triggering sync in the container. Restarting the service manually reflects changes fine, so the bind mount path is correct.

    Environment: Ubuntu 22.04, Docker Engine 26.x, Compose v2.27.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions