From 38db47ca9b5a8d95ac37b6650d8667fbcea768c6 Mon Sep 17 00:00:00 2001 From: Zeyi Fan Date: Sun, 20 Sep 2020 15:05:08 -0700 Subject: [PATCH] update README.md to add Docker Compose section --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a893191..b728e5c 100644 --- a/README.md +++ b/README.md @@ -37,18 +37,19 @@ manageable via the command line interface. ``` $ lares --help -lares 0.1.1 +lares 0.2.1 Minimal RSS service USAGE: - lares [OPTIONS] + lares [FLAGS] [OPTIONS] FLAGS: + --debug -h, --help Prints help information -V, --version Prints version information OPTIONS: - -d, --database [default: lares.db] + -d, --database [env: LARES_DATABASE=] [default: lares.db] SUBCOMMANDS: feed Manages feeds @@ -61,7 +62,7 @@ Or, to start a server: ``` $ lares server --help -lares-server 0.1.1 +lares-server 0.2.1 Starts web server USAGE: @@ -72,10 +73,11 @@ FLAGS: -V, --version Prints version information OPTIONS: - -H, --host Specifies host of server [default: 127.0.0.1] - -P, --password Specifies password used in authentication - -p, --port Specifies port of server [default: 4000] - -u, --username Specifies username used in authentication + -H, --host Specifies server host [env: LARES_HOST=] [default: 127.0.0.1] + -i, --interval Specifies crawl interval (unit: minutes) [env: LARES_INTERVAL=] [default: 30] + -P, --password Specifies authentication password [env: LARES_PASSWORD=] + -p, --port Specifies alternate port [env: LARES_PORT=] [default: 4000] + -u, --username Specifies authentication username [env: LARES_USERNAME=] ``` To start a lares server listens to `127.0.0.1:4000` that only accepts @@ -87,6 +89,37 @@ $ lares --database /var/lares.db server --host 127.0.0.1 --port 4000 \ --username lares --password apassword ``` +## Docker Compose + +If you'd like to start a Lares host with Docker Compose, you may start with +this configuration: + +```yaml +version: '3' +services: + lares: + image: fanzeyi/lares:latest + ports: + - "127.0.0.1:4000:4000" + restart: always + # Uncomment this to persist the storage on the host. + # volumes: + # - ./run/lares:/var/lares + environment: + LARES_DATABASE: /var/lares/lares.db + LARES_HOST: 0.0.0.0 + LARES_USERNAME: username + LARES_PASSWORD: password +``` + +Then you can use `docker-compose exec lares lares` to access Lares's command +line interface inside the container. For example, if you want to add a feed, +use: + +``` +docker-compose exec lares lares feed add http://example.com/ +``` + ## License -MIT \ No newline at end of file +MIT