cweagans / docker-bg-sync

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

Is docker-bg-sync compatible with Docker Compose file format version 3.x? #23

Open blaise-io opened 5 years ago

blaise-io commented 5 years ago

Any documentation or pointers on this would be appreciated.

blaise-io commented 5 years ago

I just found this closed issue: https://github.com/cweagans/docker-bg-sync/issues/10.

Still, I think it would be useful if this was in the README.

cweagans commented 5 years ago

Totally agree. I'm afk mostly today, but if you can open a PR, I'll happy merge any docs improvements that would be helpful!

geerlingguy commented 4 years ago

The PR is close, but you also have to add volumes in v3 with a named volume, and reference it in any of the containers that will use it. For example:

version: '3'

services:
  web:
    image: php:7.0-apache
    volumes:
      - shared:/var/www/myapp

  bg-sync:
    image: cweagans/bg-sync
    volumes:
      - .:/source
      - shared:/var/www/myapp
    environment:
      - SYNC_DESTINATION=/var/www/myapp
      - SYNC_MAX_INOTIFY_WATCHES=40000
      - SYNC_VERBOSE=1
    privileged: true

volumes:
  shared: