docker-sync.yml
version: "2"
options:
compose-file-path: 'docker-compose.yml'
if you like, you can set a custom location (path) of your compose file
compose-dev-file-path: 'docker-compose-dev.yml'
# 変更可能。デフォルトは docker-compose-dev.yml 。指定するcomposeファイルの場所とかパスは変更可能。使用しない場合はファイルを配置しないこと
# 指定したcomposeファイルが存在する場合は使われる。ファイルの名前を明示的に指定する場合はファイルが存在してないとだめ
verbose: true
# 選択可能。デバッグが必要な場合はtrueに設定する。デフォルトはfalse
cli_mode: 'auto'
# can be docker-sync, thor or auto and defines, how the sync will be invoked on the cli. Mostly depending if your are using docker-sync solo, scaffolded or in development ( thor )
max_attempt: 5
# optional, maximum number of attempts for unison waiting for the success exit status. The default is 5 attempts (1-second sleep for each attempt). Only used in unison.
project_root
root dirの指定
pwdかconfig_path
後者ならprojectのどこでdocker-sync startしても機能する
defaultは前者
<sync_strategy>_image: 'yourcustomimage'
# replace <sync_strategy> with either rsync, unison, native_osx to set a custom image for all sync of this type
syncs
Contaimer名を書いてその中に下記のようなruleを指定する
default-sync:
# if you want to run a custom image, set it here
image: 'yourcustomimage'
# os aware sync strategy, default to unison under osx, and native docker volume under linux
sync_strategy: 'default'
# which folder to watch / sync from - you can use tilde, it will get expanded.
# the contents of this directory will be synchronized to the Docker volume with the name of this sync entry ('default-sync' here)
src: './default-data/'
# this is only available if you use docker-for-mac edge for now
# other unison options can also be specified here, which will be used when run under osx,
# and ignored when run under linux
sync_strategy: 'unison'
# unison 2 way-sync
src
notify_terminal: true
# be aware, this only gives you a notification on the initial sync, not the syncs after changes. this is a difference
# to the rsync implementation
sync_host_ip: 'auto' # when a port of a container is exposed, on which IP does it get exposed. Localhost for docker for mac, something else for docker-machine
# default is 'auto', which means, your docker-machine/docker host ip will be detected automatically. If you set this to a concrete IP, this ip will be enforced
sync_userid: '33'
sync_args: [ '-v'
# Additional unison options
# For example, these provided options will automatically resolve conflicts by using the newer version of the file
# and append a suffix to the conflicted file to prevent its deletion.
# do not use --copyonconflict or --prefer here, those are handled by the sync_prefer setting
sync_excludes: [ '.git', '.idea', 'node_modules'
# Exclude some files / directories that matches **exactly** the path
# this currently use the the -Path option of unison, use sync_excludes_type to change this behavior
sync_excludes_type: 'Name'
# use this to change the exclude syntax.
# Path: you match the exact path ( nesting problem )
# Name: If a file or a folder does match this string ( solves nesting problem )
# Regex: Define a regular expression
# none: You can define a type for each sync exclude, so sync_excludes: ['Name .git', 'Path Gemlock'
# Name is the default since 0.2.0
sync_prefer: 'default'
# defines how sync-conflicts should be handled. With default it will prefer the source with --copyonconflict
# so on conflict, pick the one from the host and copy the conflicted file for backup
sync_strategy: 'rsync'
notify_terminal: true
# enable terminal_notifier. On every sync sends a Terminal Notification regarding files being synced. ( Mac Only ).
# good thing incase you are developing and want to know exactly when your changes took effect.
src
Container内でsyncさせたいdirのpath
sync_host_ip: 'auto'
# when a port of a container is exposed, on which IP does it get exposed. Localhost for docker for mac, something else for docker-machine
# default is 'auto', which means, your docker-machine/docker host ip will be detected automatically. If you set this to a concrete IP, this ip will be enforced
sync_host_port: 20871
# should be a unique port this sync instance uses on the host to offer the rsync service on
# set of IPs (10.0.2.2) or networks (10.0.0.0/8) that will be granted access to this rsync service, useful when running on FreeBSD with Virtualbox and a host-only interface
# sync_host_allow: '10.0.0.0/8'
sync_excludes
syncを除外するもの
sync_args: '-v'
# optional: use this to switch to rsync verbose mode
sync_userid: '5000'
# this does not user groupmap but rather configures the server to map
# optionkal: usually if you map users you want to set the user id of your application container here
# set it to 'from_host' to automatically bound it to the uid of the user who launches docker-sync (unison only at the moment)
sync_groupid: '6000'
# optional: usually if you map groups you want to set the group id of your application container here
# this does not user groupmap but rather configures the server to map
# this is only available for unison/rsync, not for d4m/native (default) strategies
watch_in_container: true
# optional: enable fswatch in the container side (unison only) to automatically retrieve files created in the container to the host
watch_excludes
watch_args: '-v'
# optional: use this to switch to fswatch verbose mode
watch_strategy: 'fswatch'
# optional: default is fswatch, if set to disable, no watcher will be used and you would need to start the sync manually
monit_enable: false
# monit can be used to monitor the health of unison in the native_osx strategy and can restart unison if it detects a problem
# optional: use this to switch monit monitoring on
monit_interval: 5
# optional: use this to change how many seconds between each monit check (cycle)
monit_high_cpu_cycles: 2
# optional: use this to change how many consecutive times high cpu usage must be observed before unison is restarted