Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit faae59f

Browse files
committed
README update, demo
1 parent 0a062e4 commit faae59f

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ gsyncd.iml
77
build
88
.env
99
/Godeps
10-
/vendor
10+
/vendor
11+
/demo

README.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,50 @@ make dev-image
5151
make image
5252
```
5353

54+
## Demo
55+
56+
The [docker-compose.yml](/docker-compose.yml) details a setup with a server and 2 clients. It will create a `./demo/` directory with 3 subfolders: `server`, `client1`, and `client2`. Each subfolder is volumed as `/share/` inside each container.
57+
58+
As files in `./demo/server` are modified, they will be altered in `./demo/client1` and `./demo/client2`.
59+
5460
Run Docker-Compose cluster:
5561

5662
```sh
5763
docker-compose up -d
58-
```
64+
```
65+
66+
Check directories:
67+
68+
```sh
69+
ls -al ./demo/server
70+
ls -al ./demo/client1
71+
ls -al ./demo/client2
72+
```
73+
74+
Add a file to server volume:
75+
76+
```sh
77+
echo "testing 123" > ./demo/server/test1
78+
```
79+
80+
Check directories again:
81+
82+
```sh
83+
ls -al ./demo/server
84+
ls -al ./demo/client1
85+
ls -al ./demo/client2
86+
```
87+
88+
At this point, the `./demo/client*` directories should contain a `test1` file.
89+
90+
## Notes
91+
92+
### Docker Environment
93+
94+
While the server configuration can be set to an IP of `0.0.0.0` (accepts traffic from anywhere), the clients need a specific address to connect to. If running locally, the clients can be set to connect to `127.0.0.1` - but this will not work in a Dockerized environment.
95+
96+
The Docker-Compose.yml file contains `links: [fs-server:fs-server]` which enables the clients to contact the server container at `http://fs-server`. This is supported in a Rancher environment as well.
97+
98+
### Rancher Environment
99+
100+
- todo

docker-compose.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ services:
1212
environment:
1313
FILESYNC_MODE: 'server'
1414
FILESYNC_PATH: '/share'
15+
volumes:
16+
- ./demo/server:/share
1517
fs-client1:
1618
image: "causticlab/filesync:dev"
1719
tty: true
@@ -27,6 +29,8 @@ services:
2729
FILESYNC_MODE: 'client'
2830
FILESYNC_IP: 'fs-server'
2931
FILESYNC_PATH: '/share'
32+
volumes:
33+
- ./demo/client1:/share
3034
fs-client2:
3135
image: "causticlab/filesync:dev"
3236
tty: true
@@ -41,4 +45,6 @@ services:
4145
environment:
4246
FILESYNC_MODE: 'client'
4347
FILESYNC_IP: 'fs-server'
44-
FILESYNC_PATH: '/share'
48+
FILESYNC_PATH: '/share'
49+
volumes:
50+
- ./demo/client2:/share

0 commit comments

Comments
 (0)