https://github.com/phase2/outrigger-unison
Unison file sync container for Outrigger
https://github.com/phase2/outrigger-unison
filesystem outrigger unison
Last synced: 9 months ago
JSON representation
Unison file sync container for Outrigger
- Host: GitHub
- URL: https://github.com/phase2/outrigger-unison
- Owner: phase2
- Created: 2017-05-10T20:25:05.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-15T22:37:56.000Z (about 8 years ago)
- Last Synced: 2025-01-12T17:35:42.498Z (about 1 year ago)
- Topics: filesystem, outrigger, unison
- Language: Shell
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unison file sync
This container is used to synchronize local files with volumes in docker containers.
This greatly improves performance of file operations within containers when using Mac OSX
vs NFS mounts that are much slower handling many small files (such as node_modules, etc)
## Installation
Install these dependencies on your Mac:
* brew install unison
* brew tap eugenmayer/dockersync
* brew install eugenmayer/dockersync/unox
## Project Setup
1. Modify your docker-composer.yml file to mount a named volume instead of using NFS.
The default name of the volume will be {ProjectName}-sync.
For example, if your docker-compose.yml contains the line:
www:
volumes:
- .:/var/www
change it to
www:
volumes:
- ProjectName-sync:/var/www
2. Add the following lines to the end of your docker-compose.yml file to define the named volume.
volumes:
ProjectName-sync:
external: true
## Usage
1. Start the unison container using the provided ``unison.sh`` script:
./unison.sh ProjectName
This will create the named docker volume, run a docker container for your unison server,
then start the local unison process to watch your local files.
The directory that you run the ``unison.sh`` script from is the directory that will
be synchronized with the mount point you specified in your project docker-compose.yml (/var/www in the above examle).
If you omit the ``ProjectName`` argument, the name of the current directory will be used.
2. Start your project containers normally.
docker-compose up -d
Any changes to your local files will be synced into your docker containers.
Any changes to the files in your docker container mount point (/var/www) will be synced to your local Mac.
If there is a conflict, the file on your local machine is given preference.
A log file: ``ProjectName-sync.log`` is created in the directory where you ran ``unison.sh``
and will show any unison sync activity.
3. To stop sychronizing files, just stop the docker container:
docker stop ProjectName-sync