Home

Awesome

bg-sync

This container continuously syncs files between two directories. This is useful for avoiding the filesystem slowness on Docker for Mac, for instance. It's also generally useful for any other time where you have a slow filesystem as a source of files that need to be read inside of a container.

Usage

This is a basic docker-compose.yml that demonstrates usage of this container.


version: '2'

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

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

Environment variables

This container uses values from a handful of environment variables. These are documented below.

Why not use x?

I've probably tried it and didn't like it for one reason or another. If you think that's not the case, open an issue. I'd love to be told about another project that makes it possible to deprecate this one.

Specific reasons:

Credits

Donations

Bitcoin donation address: 149NMUk73ETqEP3ML9sghpWQqEqAREX9z2