diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..8b0fc43 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,13 @@ +FROM node:17.9.0-bullseye + +COPY . /app + +WORKDIR /app + +RUN npm install \ + && mv /app/dat /data \ + && ln -s /data /app/dat ## Assumes /data will store configuration and vaults + +VOLUME /data + +ENTRYPOINT ["npm", "run", "dev"] diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..b1dd6cc --- /dev/null +++ b/docker/README.md @@ -0,0 +1,45 @@ +## Build the image: + +From the root directory of the [vrtmrz/filesystem-livesync](https://github.com/vrtmrz/filesystem-livesync) repository run the following to build the image: + +``` +docker build -t filesystem-livesync -f docker/Dockerfile . +``` + +## Configure the image: + +Assuming a folder at `/tmp/data` was going to store your config and vaults, write the following to `/tmp/data/config.json`: + +``` +{ + "config_1": { + "server": { + "uri": "http://example-uri/private1_vault", + "auth": { + "username": "couchdb_username", + "password": "couchdb_password", + "passphrase": "mypassphrase" // Remove if no passphrase is set for Vault + }, + "initialScan": true + }, + "local": { + "path": "/data/vault1", + "initialScan": true + }, + "auto_reconnect": true, + "sync_on_connect": true + } +} +``` + +## Run the image: + +``` +docker run -it --rm -v /tmp/data:/data filesystem-livesync +``` + +If you would like to be able to edit files from your host running Docker, it is recommended to set the `CHOKIDAR_USEPOLLING` environment variable to equal `1`: + +``` +docker run -it --rm -v /tmp/data:/data -e CHOKIDAR_USEPOLLING=1 filesystem-livesync +``` diff --git a/readme.md b/readme.md index 973c460..3660740 100644 --- a/readme.md +++ b/readme.md @@ -28,7 +28,7 @@ The configuration file consists of the following structure. "auth": { "username": "username_of_private_vault", "password": "password_of_private_vault", - "passphrase": "passphrase_of_private_vault" + "passphrase": "passphrase_of_private_vault" // Remove if no passphrase is set for your vault }, "path": "shared/", // All documents under this path will synchronized. "initialScan": false // If you enable this, all server files will be synchronized to local storage once when daemon has been started.