From a0cb3dccae3e363ab0c0af43388fb5ff340158ec Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Tue, 10 Jan 2023 16:29:32 +0100 Subject: [PATCH] Document the Docker support --- README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0858ce5..72cebde 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,9 @@ port = 8080 This will work independent of the type of build. For more about Rocket's configuration, see: . -Finally, using Cargo, it is easy to build and run Solar Grabber, just run: +### Using cargo + +Using Cargo it is easy to build and run Solar Grabber. just run: ```shell $ cargo run --release @@ -53,6 +55,30 @@ $ cargo run --release Running `/path/to/solar-grabber/target/release/solar-grabber` ``` +### Using Docker (Compose) + +Using `docker-compose` it is easy (to build and) run using a Docker image. +If you do not change `docker-compose.yml` it will use `Rocket.toml` from +the current working directory as configuration: + +```console +$ docker-compose up +... +``` + +To use Docker directly, run to build an image and the run it: + +```console +$ docker build --rm --tag solar-grabber:latest . +... +$ docker run --rm -v ./Rocket.toml:/app/Rocket.toml -p 2399:8000 solar-grabber-latest +... +``` + +This also uses `Rocket.toml` from the current working directory as configuration. +You can alternatively pass a set of environment variables instead. See +`docker-compose.yml` for a list. + ## API endpoint The `/` API endpoint provides the current statistical data of your solar panels