diff --git a/rslsync/Dockerfile b/rslsync/Dockerfile index af954d1..3c7c2e6 100644 --- a/rslsync/Dockerfile +++ b/rslsync/Dockerfile @@ -7,19 +7,19 @@ MAINTAINER kev RUN set -xe \ && apt-get update \ - && apt-get install -y curl \ + && apt-get install -y ca-certificates curl zip \ && curl -sSL https://download-cdn.getsync.com/stable/linux-x64/resilio-sync_x64.tar.gz | tar xz -C /usr/bin/ rslsync \ && apt-get purge -y --auto-remove curl \ && rm -rf /var/lib/apt/lists/* -COPY config.json /etc/rslsync/ - +ENV CONFIG_FILE /etc/rslsync.conf ENV STORAGE_PATH /data/.syncsystem ENV DIRECTORY_ROOT /data/syncaod -VOLUME /etc/rslsync /data +COPY rslsync.conf $CONFIG_FILE +VOLUME /data EXPOSE 8888 55555 CMD set -xe \ && mkdir -p "$STORAGE_PATH" "$DIRECTORY_ROOT" \ - && rslsync --nodaemon --config /etc/rslsync/config.json + && rslsync --nodaemon --config "$CONFIG_FILE" diff --git a/rslsync/README.md b/rslsync/README.md index d1b2a06..bd9540f 100644 --- a/rslsync/README.md +++ b/rslsync/README.md @@ -3,5 +3,44 @@ rslsync [Resilio Sync][1] is a fast, simple, and secure file syncing for IT and individuals. +## docker-compose.yml + +```yaml +rslsync: + image: vimagick/rslsync + ports: + - "8888:8888" + - "55555:55555" + volumes: + - ./data:/data + - ./rslsync.conf:/etc/rslsync.conf + restart: always +``` + +## rslsync.conf + +```json +{ + "device_name": "My Sync Device", + "listening_port": 55555, + "storage_path": "/data/.syncsystem", + "pid_file": "/var/run/rslsync.pid", + "use_upnp": false, + "download_limit": 0, + "upload_limit": 0, + "directory_root": "/data/syncaod", + "directory_root_policy": "all", + "webui": { + "listen": "0.0.0.0:8888" + } +} +``` + +## up and running + +```bash +$ docker-compose run --rm rslsync --dump-sample-config > rslsync.conf +$ docker-compose up -d +``` [1]: https://getsync.com/ diff --git a/rslsync/config.json b/rslsync/config.json deleted file mode 100644 index e53d91a..0000000 --- a/rslsync/config.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "device_name": "Resilio Sync Server", - "listening_port": 55555, - "storage_path": "/data/.syncsystem", - "pid_file": "/data/.syncsystem/btsync.pid", - "use_upnp": false, - "download_limit": 0, - "upload_limit": 0, - "webui": { - "listen": "0.0.0.0:8888", - "directory_root": "/data/syncaod" - } -} diff --git a/rslsync/docker-compose.yml b/rslsync/docker-compose.yml index d868ccb..42fa744 100644 --- a/rslsync/docker-compose.yml +++ b/rslsync/docker-compose.yml @@ -5,4 +5,5 @@ rslsync: - "55555:55555" volumes: - ./data:/data + - ./rslsync.conf:/etc/rslsync.conf restart: always diff --git a/rslsync/rslsync.conf b/rslsync/rslsync.conf new file mode 100644 index 0000000..717c147 --- /dev/null +++ b/rslsync/rslsync.conf @@ -0,0 +1,14 @@ +{ + "device_name": "My Sync Device", + "listening_port": 55555, + "storage_path": "/data/.syncsystem", + "pid_file": "/var/run/rslsync.pid", + "use_upnp": false, + "download_limit": 0, + "upload_limit": 0, + "directory_root": "/data/syncaod", + "directory_root_policy": "all", + "webui": { + "listen": "0.0.0.0:8888" + } +} diff --git a/rslsync/rslsync.service b/rslsync/rslsync.service index a625618..0f371f4 100644 --- a/rslsync/rslsync.service +++ b/rslsync/rslsync.service @@ -1,12 +1,12 @@ [Unit] Description=Resilio Sync Daemon After=network.target -AssertPathExists=/etc/btsync/config.json +AssertPathExists=/etc/rslsync.conf AssertPathIsDirectory=/data/.syncsystem AssertPathIsDirectory=/data/syncaod [Service] -ExecStart=/usr/bin/btsync --nodaemon --config /etc/btsync/config.json +ExecStart=/usr/bin/rslsync --nodaemon --config /etc/rslsync.conf Restart=always RestartSec=10