Skip to content

Commit 3f8a42d

Browse files
committed
Update documentation to run from docker
1 parent 986e417 commit 3f8a42d

3 files changed

Lines changed: 29 additions & 4 deletions

File tree

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,34 @@ The script uses the YNAB and Splitwise APIs to perform the synchronization. It f
2929
3030
3131
## Usage
32-
This project uses poetry to manage its dependencies
32+
This project uses poetry to manage its dependencies.
3333
34-
To run the script, simply execute python sync.py in your terminal. The script will synchronize all flagged transactions from the past day from YNAB to Splitwise for each account specified in the config.yml file.
34+
### Local Development
35+
You can use this setup to locally develop and test this script.
36+
It will build the docker image and mount the code as a volume in the container.
37+
38+
1. `docker-compose up`
39+
40+
### Production
41+
This docker-compose file uses the registry to pull the image and mount only the configuration file.
42+
43+
```
44+
docker-compose -f docker-compose.prod.yml up
45+
```
46+
47+
Alternatively you can use a docker command directly:
48+
49+
```
50+
docker run -v ./config.yml:/app/config.yml ghcr.io/gperiard/ynab2splitwise:latest
51+
```
52+
53+
### Run as a cronjob
54+
Ultimately, this script is meant to be run as a cronjob.
55+
56+
Here's a configuration example to run the script every hour:
57+
```
58+
0 * * * * docker run -v <CONFIGURATION PATH>:/app/config.yml ghcr.io/gperiard/ynab2splitwise:latest
59+
```
3560
3661
## Contributing
3762
Pull requests are welcome.

docker-compose.prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: '3'
22
services:
33
syncer:
4-
image: gperiard/ynab2splitwise:latest
4+
image: ghcr.io/gperiard/ynab2splitwise:latest
55
volumes:
66
- ./config.yml:/app/config.yml

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ services:
33
syncer:
44
build: .
55
volumes:
6-
- ./ynab2splitwise:/app
6+
- ./ynab2splitwise:/app/ynab2splitwise
77
- ./config.yml:/app/config.yml

0 commit comments

Comments
 (0)