cweagans / docker-bg-sync

A container that syncs files between two configurable directories.
224 stars 39 forks source link

Not Syncing #7

Closed FatherShawn closed 7 years ago

FatherShawn commented 7 years ago

I have your container running via docker-compose without detaching docker-compose so I can watch the logs. If I change a file on my Mac and then inspect /source by executing a shell in your container, I can see the file changed in source, but there is no reaction in the log and the change does not propogate to destination. Here's the compose section:

  bg-sync:
    image: cweagans/bg-sync
    networks:
      - internal
    volumes:
      - .:/source
      - docroot:/var/www
    privileged: true
    environment:
      SYNC_VERBOSE: 1
      SYNC_DESTINATION: /var/www
      SYNC_MAX_INOTIFY_WATCHES: 40000
      SYNC_NODELETE_SOURCE: 0
      SYNC_EXTRA_UNISON_PROFILE_OPTS: |
       ignore = Name {node_modules,bower_components,.DS_Store}
       ignore = Path docroot/sites/default/files
volumes:
  docroot:

Any recommendation on how to debug?

FatherShawn commented 7 years ago

The issue seems to be fsmonitor. I like the idea of no changes on the host but maybe this isn't going to work with my setup. fsmonitor is running but unison just sits here after the initial sync:

bg-sync_1    | Reconciling changes
bg-sync_1    | [recon] reconcileAll
bg-sync_1    | [recon] reconcile: 0 results
bg-sync_1    | [update] Marking 0 paths equal
bg-sync_1    | Nothing to do: replicas have not changed since last sync.
leymannx commented 6 years ago

By default the contents from the source folder (inside the container) are left unchanged. You have to set SYNC_PREFER: newer.